Absorb `@gitterhq/translations` npm module (including history)
This MR takes the whole https://gitlab.com/gitlab-org/gitter/gitter-translations repository and moves it into modules/translations
including commit history.
Why?
Every community contribution to translations brings unnecessary overhead on the Gitter team:
- review the change
-
npm link
the translation and test it (if it's more complex) - release
@gitterhq/translations
module - upgrade this npm module in the
webapp
project (another MR that needs to be reviewed)
On top of that the translations are notorious for getting out of sync https://gitlab.com/gitlab-org/gitter/gitter-translations#generating-keys-and-placeholders
However, there is no other client for this module than webapp
. The original reason for the separation was (I assume) the fact that webapp
had a closed source, but we still welcomed translations from the community.
How?
Since the vast majority of the commits are contributions from community members, it is critical that we keep the history and not squash the commits into one with my name on it.
-
roughly follow this gist to move everything in
gitter-translations
repo tomodules/translations
subfoldergit filter-branch --tree-filter 'mkdir -p /tmp/gitter; mv * /tmp/gitter; mkdir -p modules/translations; mv /tmp/gitter/* modules/translations/' --tag-name-filter cat --prune-empty -- --all
-
then add the
gitter-translations
repo as a remote towebapp
(assuming both repos are in the same parent directory)git remote add translations ../gitter-translations git fetch translations
-
then rebase all the translations on
webapp
develop
branchgit co develop git co -b absorb-translations-with-history translations/master git rebase develop
-
at this stage there were a couple of rebase conflicts (no idea why) I resolved them but then at the end had to create 3273ff06 to make sure that the
modules/translations
is identical to themaster
branch ofgitter-translations
-
make
webapp
use the subfolder as translations module 5dcad4e8 and add translations to eslint and prettier ignore files
Testing
- checkout this branch
absorb-translations-with-history
- test multiple translations according to the links mentioned in https://gitlab.com/gitlab-org/gitter/gitter-translations#generating-keys-and-placeholders
Note: The auto generating of translations placeholders is causing nodemon
to restart the webapp
because it notices the change in modules/translation
. This behaviour is only showing in development and it's not an issue. I've used it to generate all the missing keys f9184598.