On Mon, Apr 13, 2020, at 10:49 AM, Daniele Pizzolli wrote:
> 
> Daniele Pizzolli writes:
> 
> > Done, it seems that not everything (95% overall) was imported, but on my
> > side I have 100% (at least from 3 days ago).
> >
> > I will check it later why or tomorrow and report any issue!
> 
> Hello!
> 
> I do not know the details but the gnu gettext tools and weblate do
> something differently.  Maybe there is a option to force the same
> behavior?  To get the initial po for mailman I used the instruction in:
> 
> src/mailman/docs/internationalization.rst

I just updated it yesterday to use update-pot.sh

> 
> And translated everything.  And now, after the import, I see additional
> lines like:
> 
>     msgid "list:admin:notice:subscribe.txt"
>     msgstr ""
> 
> I guess that those lines are related to the messages in
> src/mailman/templates/en/*txt.

Right.

> 
> It seems that the weblate interface resolve in some way the reference
> and display the file content instead of the file name.  Maybe there is
> something magic happening?

Yes, there is ;-) 

So the issue I had was that these template files are .txt files and it is hard 
to signal GNU xgettext to add them to the po files. So, I read a bit more about 
translation guides and it turns out that msgid in .po files don't really have 
to be the source string, but only an identifier and by default the identifier 
is the english version.

So, I changed the identifier for only template files to be called the name of 
the text file. This worked well for the code. They are called "monolingual" po 
files and Weblate supports them. For helping translators, it will display 
original source string from a reference .po file, which in our case is the 
English version. 

   https://docs.weblate.org/en/latest/formats.html#bimono
   
This also remind me of a bug in update-pot.sh script, it doesn't add the right 
source strings in the English .po file. I'll file a bug for it. 

> 
> I see that there are other languages templates... so what the
> translation should be?  The translated string or the template file name
> containing the translation?  Why not use the {% trans %} in templates?

Translation should be the translated string, but the msgid would be the file 
name not the value. You can look at the English po file for reference.
 
> Ah, now I saw the update-pot.sh!  But something is still not clear to
> me.
> 
> Is there a way to get the file content as msgid or as comment to ease
> the offline translation?  Or can I simply add my translation in place in
> src/mailman/templates/it/ and make a pull request?

You can look at the English translation as a reference, same as Weblate. But I 
can also add the English text as comments in the po file if you feel that is 
easier for you. It just needs updating the simple update-pot.sh script that you 
saw already.

> Maybe just adding the template string to the po will streamline the
> interaction both with weblate and any offline tool while waiting for a
> long term solution. I may work on little patch if you agree.

> 
> Let me know your suggestion and then I will complete the translations!
> 
> Best,
> Daniele
>

-- 
  thanks,
  Abhilash Raj (maxking)
_______________________________________________
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9

Reply via email to