These are chat archives for mirumee/saleor

30th
Aug 2018
Stephen Moloney
@stephenmoloney
Aug 30 2018 19:15
Hi, I'm wondering about the translations. Is transifex required? Can the translations just be done manually instead ?
I'm a bit confused about it.
Stephen Moloney
@stephenmoloney
Aug 30 2018 19:28
or say not manually, but if the .po files are updated with translations, is there some commands to make them work without transfix. In other words, can transifex be disabled completely and some alternative commands used instead.
NyanKiyoshi
@NyanKiyoshi
Aug 30 2018 19:37

Transifex is only used to allow users to translate the strings and then we pull the changes from transifex to the project. You can edit the pot files and then upload to transifex without going to transifex's translation interface.

I don't get what alternative commands you are looking for? You don't need transifex to edit or compile the pot files. You want to pull from transifex without tx pull?

Stephen Moloney
@stephenmoloney
Aug 30 2018 19:42
I don't understand transifex. Why is a cloud service needed, are the po files not sufficient ?
Also, is transifex a paid service ?
Sorry, to be clear, I don't want to use transifex at all, just the pot files.
Is it possible?
We use gettext in elixir and there are a few commands for generating po files in each language and then compiling after the po files have been filled in
NyanKiyoshi
@NyanKiyoshi
Aug 30 2018 19:49

We use transifex because it allows people to contribute easily to Saleor simultaneously and without having to open PR every time a string is changed, and we can review changed strings from transifex. That's just that. It's a translation platform.

Saleor is using babel with pgettext (instead of the GNU gettext). To manually edit the pot file, you just have edit the .po files. To compile the changes, you run manage.py compilemessages. To update the changes you made to the source code (where you put pgettext(...) or {% trans ... %}) you do a manage.py makemessages.

The transifex commands have nothing to do with that. They only push and pull changes.

Stephen Moloney
@stephenmoloney
Aug 30 2018 19:49
@NyanKiyoshi , thanks, that answer is pretty clear!
So basically, whether one uses transifex or not, is the commands python3 manage.py compilemessages && python3 manage.py makemessages required ?
Transifex looks like a good service but there is a cost associated with it.
NyanKiyoshi
@NyanKiyoshi
Aug 30 2018 19:52
Yes. But, every week @patrys is pulling changes from transifex and compiling them. And is pushing to transifex. So you have to merge the local changes if there are other strings added.
For non-opensource projects yes
Stephen Moloney
@stephenmoloney
Aug 30 2018 19:53
I suppose, I mean if using a forked repository, I don't think I would want transifex.
Not yet anyways.
So in terms of jobs that run on application bootup, is python3 manage.py compilemessages && python3 manage.py makemessages something you would run after your DB migrations ?
(I'm now thinking about an additional requirement for the helm charts)
NyanKiyoshi
@NyanKiyoshi
Aug 30 2018 20:03

For native English and non multi-languages projects, yes, there is no worries about that.

Depends, the pot files are always shipped pre-compiled with Saleor. So it depends if the fork also compile the pot files (manage.py compilemessages so) every time a change was done to them.
Then, makemessages is not the application's job to ensure the pot files are containing all the source code strings. But the developer's job on that. Once again makemessages's job is to extract the strings from the python and django templates codes to the pot files.

Stephen Moloney
@stephenmoloney
Aug 30 2018 20:13
Ah, yes, so makemessages --> extracts messaged into po files
compilmessages --> what does that do again ?
Stephen Moloney
@stephenmoloney
Aug 30 2018 20:21
So in summary, my conclusion is that transifex is an optional tool and does not need to be used. manage.py makemessages should be run by the developer to update the pot files. Then run manage.py compilemessages by the developer after the translations are complete. These changes are then checked into version control.
Sound about right ?
And no need to make a job in helm to do all of that, the developer should do it him/herself and check into version control.
NyanKiyoshi
@NyanKiyoshi
Aug 30 2018 20:43
compilemessages generates .mo files, which are the pot files compiled and used by the application