International Forums > Japanese - 日本語

Status: re-generating EN canonical .pot file

<< < (2/2)

dotike:
Hi Isaac,

Quote from: dotike on Today at 02:36:48 AM


--- Quote ---
--- Quote ---    - The branch I'm working from is now 28 days old, and I'll need to check the diff for any relevant changes to the translation file.
    (Incedentally, I found a number of odd gettext calls in the source which I'll address later)

--- End quote ---

I read about those in your commits. The gettext() usage is quite bizarre at times. If you can point me to the lines or add pull requests for those that'd be lovely.
--- End quote ---

Indeed- after this hurdle is past, I'll start doing them small and granular.
Watching yall' commit in the last month, I realized that I may be a bit premature submitting changes- since yall' are deleting/reworking bits, it'd be a shame for me to waste time cleaning up lines of code which will disappear.


--- Quote ---Speaking of gettext, I was thinking we should maybe consider doing the "__()" trick consistently. For one "_()" is just easier on the eyes and the double underscore makes it possible to replace the translation function if we ever decide to switch to non-gettext variants. What do you think?
--- End quote ---

I'm not sure I know/understand that trick, what is it?  If it makes it easier to read or parse, I'm all for it.  I'd love to one day see something with less GNU take the place of gettext, but I'm totally not thinking about that right now.

The only thing I can say is that my experiences is that many hands may touch the code, so if it's not extremely clear what the convention is, it'll get botched.  (A knucklehead like myself can grep for all gettext calls and get 99% of the way there with what I'm doing, for example.)


--- Quote ---
--- Quote ---Quote from: dotike on Today at 02:36:48 AM

    - After a lot of slogging through the source code, I could generate much of the English .pot file content in an automated manner.  Yet, as with problems like this, comprehensive parsers take far longer to write than just editing the file- there are so many edge cases for how the strings are handled in the codebase.

--- End quote ---

I'm all for ditching edge cases. Maybe we also need guidelines on what is translated and how dynamic strings and html are embedded (or not). A wiki page or README on this would certainly help to keep the English translations high in quality. I'm not a professional in that regard as well, so I believe that would be a chance to improve and share knowledge.
--- End quote ---

Certainly- I'm no I18N expert, but I think basic coding policies are always good.  But some of the trouble cases are so obvious, they merely require sane eyes to clean up.  For example, here's a fun one:


--- Code: ---core:src/www/interfaces.php:2150
--- End code ---

Frankly, as much as this line is freaky- with the age and number of hands that have been on this code- I'm surprised at it's quality.  I've unfortunately seen much much worse, professionally speaking.

I've got about 450 "bad" lines left in the EN .pot, (Stopping around line 6953 of 27061 tonight), which leaves me plenty of time to ponder some basic things to contribute to README/quickstart guidelines...  I'll try to keep some notes as I go.


--- Quote ---
--- Quote ---Quote from: dotike on Today at 02:36:48 AM

    Expected outcome: when I'm done with this pass, a functional .en POT file will be ready to push upstream, and I'll submit a pull request as soon as that's ready.  Yet, there will be a few things still to do from there:
--- End quote ---


Looking forward to it. :)
--- End quote ---

You can bet your ass at this point I'm looking forward to finishing this file too :)


--- Quote ---
--- Quote ---Quote from: dotike on Today at 02:36:48 AM

    - OPNsense core will want to maintain the English file, as the canonical base for all other languages
    - The gettext machinery will need to be hooked up in to make it all work
--- End quote ---


Agreed, we can definitely do that.
--- End quote ---

Sweet!
In the future, so you don't feel burdened- I (and I hope others), will certainly help to keep things up to date too.
I'm mostly focused on keeping track of Japanese as time moves on, but keeping track of the English file is of course fundamental to that effort.

But for now, so glad you guys are hacking on the important bits :)

/salute

franco:

--- Quote from: dotike on April 12, 2015, 10:26:35 am ---Watching yall' commit in the last month, I realized that I may be a bit premature submitting changes- since yall' are deleting/reworking bits, it'd be a shame for me to waste time cleaning up lines of code which will disappear.
--- End quote ---

Please keep doing that. I realise there is much to clean up but having more patches maybe makes us more aware of problems or stale code than without reviewing said patches. I'll do my best to merge pull requests manually and selectively no matter how far the code base has progressed.


--- Quote from: dotike on April 12, 2015, 10:26:35 am ---I'm not sure I know/understand that trick, what is it?  If it makes it easier to read or parse, I'm all for it.  I'd love to one day see something with less GNU take the place of gettext, but I'm totally not thinking about that right now.
--- End quote ---

I think wordpress uses "__()" for all translations and redefines it to gettext(). gettext() itself defines _() so even though it's shorter if gettext() goes away we have to replace _() too or maybe do compat glue that potentially breaks while syncing the PHP shared objects like gettext or a sensible replacement. "__()" we can define via PHP and move to any function we want. That is e.g. great for trying replacements from a dev perspective without breaking the code or ugly hacks as only the call inside __() needs to be adjusted leaving the rest of the code as is.


--- Quote from: dotike on April 12, 2015, 10:26:35 am ---Certainly- I'm no I18N expert, but I think basic coding policies are always good.  But some of the trouble cases are so obvious, they merely require sane eyes to clean up.  For example, here's a fun one:


--- Code: ---core:src/www/interfaces.php:2150
--- End code ---

Frankly, as much as this line is freaky- with the age and number of hands that have been on this code- I'm surprised at it's quality.  I've unfortunately seen much much worse, professionally speaking.
--- End quote ---

I looked at &nbsp; and thought well, that's not so bad--not realising the string spans multiple lines including HTML. :D

I think you are right. The translations have been maintained with fair quality as it stood the test of time (and the Portuguese is really good and thorough as far as I remember).


--- Quote from: dotike on April 12, 2015, 10:26:35 am ---Sweet!
In the future, so you don't feel burdened- I (and I hope others), will certainly help to keep things up to date too.
I'm mostly focused on keeping track of Japanese as time moves on, but keeping track of the English file is of course fundamental to that effort.

--- End quote ---

I understand. We constantly fiddle with the wording and clarity of the text and it makes a lot of sense to take care of the English translation file directly and steadily. I'm all for small incremental changes as opposed to large drop ins that put the workload on the other translations (e.g. right before a release; makes no sense at all).


Cheers,
Franco

dotike:
こにちわ、

以下の機械翻訳を言い訳をしてください、

ちょうどヘッドアップ - 英語.POTファイル上の最初のパスが完了しました。
--
Just a heads up - The first pass on the English .pot file is complete.

https://github.com/opnsense/core/pull/144

Best,
.ike

dotike:
Hi All,

Just a heads up, the EN canonical .pot file is completed, and the OPNsense team has built tooling around helping manage keeping it up to date!

https://github.com/opnsense/core/blob/master/src/share/locale/en_US/LC_MESSAGES/OPNsense.pot

Best,
.ike

Navigation

[0] Message Index

[*] Previous page

Go to full version