FreshRSS icon indicating copy to clipboard operation
FreshRSS copied to clipboard

release translation files as gettext (.po) (feature request)

Open nikoss opened this issue 8 years ago • 10 comments

It would make translation easier.

See also... http://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/php.html#non-conformance

nikoss avatar Jun 07 '17 23:06 nikoss

Good suggestion

Alkarex avatar Jun 08 '17 06:06 Alkarex

  • 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

aledeg avatar Jan 14 '18 08:01 aledeg

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.

aledeg avatar Mar 05 '18 20:03 aledeg

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.)

Frenzie avatar Mar 05 '18 20:03 Frenzie

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.

Alkarex avatar Mar 05 '18 20:03 Alkarex

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).

Frenzie avatar Mar 05 '18 21:03 Frenzie

CPU time and memory, in particular, yes.

Alkarex avatar Mar 05 '18 21:03 Alkarex

@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¢

aledeg avatar Mar 06 '18 05:03 aledeg

Is it still a topic with PHP7/8?

math-GH avatar Sep 04 '22 17:09 math-GH

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.

Frenzie avatar Sep 04 '22 21:09 Frenzie