-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Symfony Translations to synchronize translations with Lokalise #1648
Conversation
…(e.g. RDF properties)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1648 +/- ##
============================================
- Coverage 70.71% 70.69% -0.03%
- Complexity 1647 1649 +2
============================================
Files 32 33 +1
Lines 4323 4330 +7
============================================
+ Hits 3057 3061 +4
- Misses 1266 1269 +3 ☔ View full report in Codecov by Sentry. |
…ssue1527-translation-symfony
…n from twig templates that use link_url filter
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
TODO:
|
… to get the console working, so they could perhaps be moved into dev dependencies
It was pretty difficult to properly initialize the project on the Lokalise side so that it works with Symfony Translate push and pull commands. One crucial thing is that all the translation keys need to have the filename
Now the project should have all keys and all available translations on the Lokalise side. After this point, only English language translations need to be pushed (e.g. after extracting new keys from templates). Pulling is more reliable and should be done for all languages regularly. Push command for English:
Pull command for a single language (the format parameter is important!):
Pull command for all languages:
NOTE: Pulling the English language translations with the |
Steps for extracting new message ids, adding them to Lokalise, translating them to other languages, then pulling back:
|
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Preliminary documentation: https://github.com/NatLibFi/Skosmos/wiki/Translation-for-Skosmos-3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first, there was some uncertainty about whether the system was actually updating the data correctly (deletion in Lokalise -> deletion locally as well), but it seems that it worked correctly after all. Although the feature branch can be merged, further testing should still be done just to be sure.
Translations can be maintained with the Symfony-Lokalise combination (pull, push, extract) but not yet by extracting from Vue code (#1648) At first, there was some uncertainty about whether the system was actually updating the data correctly (deletion in Lokalise -> deletion locally as well), but it seems that it worked correctly after all. Although the feature branch can be merged, further testing should still be done just to be sure. Add cypress tests for alphabetical index + add new test vocab Add cypress test for alt labels Add cypress files for alphabetical index and hierarchy Move alphabetical index cypress tests from vocab-home.cy.js + add checks for spinners Change test vocab name Fix uriSpace Fix uri space in test vocab
Translations can be maintained with the Symfony-Lokalise combination (pull, push, extract) but not yet by extracting from Vue code (#1648) At first, there was some uncertainty about whether the system was actually updating the data correctly (deletion in Lokalise -> deletion locally as well), but it seems that it worked correctly after all. Although the feature branch can be merged, further testing should still be done just to be sure. Add cypress tests for alphabetical index + add new test vocab Add cypress test for alt labels Add cypress files for alphabetical index and hierarchy Move alphabetical index cypress tests from vocab-home.cy.js + add checks for spinners Change test vocab name Fix uriSpace Fix uri space in test vocab
Translations can be maintained with the Symfony-Lokalise combination (pull, push, extract) but not yet by extracting from Vue code (#1648) At first, there was some uncertainty about whether the system was actually updating the data correctly (deletion in Lokalise -> deletion locally as well), but it seems that it worked correctly after all. Although the feature branch can be merged, further testing should still be done just to be sure. Add cypress tests for alphabetical index + add new test vocab Add cypress test for alt labels Add cypress files for alphabetical index and hierarchy Move alphabetical index cypress tests from vocab-home.cy.js + add checks for spinners Change test vocab name Fix uriSpace Fix uri space in test vocab
Reasons for creating this PR
This PR brings in more Symfony components so that we can use Symfony Translations to manage the translation files and to synchronize them with Lokalise (see #1527). Also, the message format for translations is changed from
po
files to JSON (see #1525).Despite adding more Symfony dependencies, we won't go all-in for Symfony, so we are not using it as the main MVC framework but rather rely on our own, simple ad-hoc MVC application structure.
Support for PHP 8.0 is dropped because Symfony 6.4 doesn't support it and it's EOL in any case.
Link to relevant issue(s), if any
Description of the changes in this PR
message.XX.json
, where XX is the language code.inc
to.inc.twig
in order to enable extracting translation strings from themKnown problems or uncertainties in this PR
debug:translations
shows a lot of "unused" messages. We need a separate solution for translating Vue messages. (See also Translate messages shown by Vue components #1523)Checklist
.sr-only
class, color contrast)