- 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)
- 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.
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:
- 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
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)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.
- 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)
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?
QuoteQuote 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.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.
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.
core:src/www/interfaces.php:2150
QuoteQuote 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:Looking forward to it.
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:
QuoteQuote 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 workAgreed, we can definitely do that.
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
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.
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.
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: [Select]core:src/www/interfaces.php:2150Frankly, 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.
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.