FreshRSS
FreshRSS copied to clipboard
release translation files as gettext (.po) (feature request)
It would make translation easier.
See also... http://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/php.html#non-conformance
Good suggestion
- https://lingohub.com/blog/2013/07/php-internationalization-with-gettext-tutorial/
- http://php.net/manual/en/function.gettext.php
- http://php.net/manual/en/book.gettext.php
What would be a better idea? Rework the whole translation system to use gettext or having something that converts po files to our format?
I think the former is better but that means a lot of work and also new dependencies.
I happen to think the current system is pretty good and very easy to use, but gettext is fine too. The best in many ways, and there's no need to reinvent the wheel.
Would we need to include https://launchpad.net/php-gettext/ as a fallback? Does the gettext extension work without the proper locale present? (gettext can be a bit too clever sometimes.)
I do not have a strong opinion either way. I have not looked into PO so much, but one of the things I am interested in is whether it introduces any overhead compared to what we have now.
Overhead in what sense? I think performance might actually be faster with the gettext extension compared to PHP arrays (but PHP 7 immutable arrays might change that; it's not like I've benched it or anything).
CPU time and memory, in particular, yes.
@Alkarex regarding CPU time and memory, I think that the problem won't be how we store translations but how we use them. I've check how they are served and there is no cache. That means that we process files for each requests instead of building a cache file once and use that file. My thoughts are that we should implement a cache for i18n before thinking of another way of storing strings. As @Frenzie mentioned it, the current system is pretty good. My former boss have this motto, if it ain't broken, don't fix it. My 2¢
Is it still a topic with PHP7/8?
The PHP version shouldn't really affect anything? There are advantages to GetText (or possibly Fluent) for translators, mainly tooling in the form of e.g. Lokalize, Poedit, Virtaal, and Weblate. That would make it easier for people to contribute translations. There are also additional advantages relating to plural forms.