-
Notifications
You must be signed in to change notification settings - Fork 4
Merge! Conflict with origin master
When you want to add your changes to this repository's documentation, you may need to merge with origin/master if you have conflicts.
If the conflict is not from the po-files then using "git merge origin/master" should solve your problem.
Otherwise, the po-files merging is a more complex process...
To make it easier @jaumef wrote the merge.sh script.
So just run:
$ ./merge.sh
But you can always merge on your own way.
-
Clean your repository (commit all remaining files, delete unused ....)
-
Save your po-file with the translations into a file.
i.e.:$ cp messages.local.po locales/es_ES/LC_MESSAGES/messages.po
-
Get the po-file from origin/master (there are serveral ways to do this)
i.e.:git checkout origin/master -- locales/es_ES/LC_MESSAGES/messages.po cp messages.remote.po locales/es_ES/LC_MESSAGES/messages.po # checkout origin/master adds the file to commit, which may be undone git reset HEAD locales/es_ES/LC_MESSAGES/messages.po git checkout locales/es_ES/LC_MESSAGES/messages.po
-
Merge the pofiles. Using
msgcat --use-first
is usefull for most cases.
Just run:msgcat --use-first messages.local.po messages.remote.po -o messages.merged.po # And replace the unmerged messages.po file mv messages.merged.po locales/es_ES/LC_MESSAGES/messages.po
-
Clean the repository from tmp files and watch out for possible troubles.
Then justgit commit
your changes and we're DONE.
-
Another branch deleted a string from the same pofile. After the merge is done, you won't:
-
Pass the test because the new pot-file will have less strings than the new po-file
-
OR the new po-file won't have all the strings translated.
There's a little bug showing sometimes on this case, I couldn't restrain better it's appearence.
To solve this:
- Remove the old
locales/messages.pot
file - Build your documentation using
mkdocs build -f mkdocs_es.yml --clean
This command will create a new pot file with the - Update the
locales/es_ES/LC_MESSAGES/messages.po
file using:
msgmerge -U locales/messages.pot locales/es_ES/LC_MESSAGES/messages.po
- Run the test
python check_strings.py
and translate the strings if needed.
-