Possible consolidation of all translation dictionary files #5541
goplayoutside3
started this conversation in
Ideas
Replies: 1 comment
-
After consideration of dev time needed to consolidate, and time needed to research a system of importing the consolidated dictionaries to various FEM packages, we're going to keep translation dictionaries in their separate packages. This discussion will remain in Github to document the decision. The benefits of consolidation (dictionary of common phrases, and one Lokalise project) could still be considered in the future, but for now our dev team has limited capacity and consolidation is not worth the dev time at the moment. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Current Dictionary Structure
The current file structure for static translation keys in FEM is
.json
files in each individual package:In Lokalise, each FEM package has its own "project". This setup was intentional due to Lokalise's export feature. When a Lokalise project is connected to a Github repository, the export-to-file-path config is not fine grained enough to split up and export certain translation keys to certain directories in various FEM packages (i.e.
/public
in an app, but/translations
in a lib).Future Considerations
The number of packages is expanding in FEM due to current development of lib-user and app-root. In the future, more library packages will likely be added to facilitate migration of
/lab
and/talk
into FEM. To mitigate complication of connecting more and more packages as "projects" in Lokalise, I think we should consider consolidating all.json
translation dictionaries into one place in the FEM repo and into one Lokalise project.Consolidation would open the opportunity for a
common.json
file - a dictionary for repetitive phrases such as "About" labels. Furthermore, Zooniverse is considering hiring professional translators to complete the static translations in Lokalise. All dictionaries in one project would make the translator hiring process easier, and remove the need for a minimum $ per language per Lokalise project.Potential Solution
We could consolidate all translation dictionaries into a lib-translations package (open to renaming). One example of a small, static published package in FEM is lib-grommet-theme. It consists of one static theme object, but is published to @zooniverse/grommet-theme. When new translations are exported to FEM's repo from Lokalise, there would be an extra step of publishing the updated lib-translations package, updating the version number in all other FEM packages, etc.
Questions
Our Next.js apps use next-i18next. The dictionaries are placed in the app's
/public
folder, and accessed via serverSideTranslations(). If dictionaries must be imported from an external package, how would this system work?next-18next
assumes the existence of next-i18next.config.js, so I'm not sure how to configure yet.Please feel free to link additional resources, or propose more solutions!
Beta Was this translation helpful? Give feedback.
All reactions