elementary / website

The elementary.io website
https://elementary.io
MIT License
1.24k stars 707 forks source link

Translate the website [$50 awarded] #37

Closed danirabbit closed 9 years ago

danirabbit commented 9 years ago

We should probably get this set up sooner than later

--- The **[$50 bounty](https://www.bountysource.com/issues/7626065-translate-the-website?utm_campaign=plugin&utm_content=tracker%2F10548672&utm_medium=issues&utm_source=github)** on this issue has been claimed at [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F10548672&utm_medium=issues&utm_source=github).
ghost commented 9 years ago

Yes, I agree - it's always been a PITA to add translations after all the strings have been hardcoded into the page in the past. It's probably worth discussing how we should go about this (considering we're now not using any sort of framework or server side language (yet)).

danirabbit commented 9 years ago

I imagine we should probably go with some solution that works with a github plugin for translations. Anybody have any leads on that sort of thing?

PhillipSz commented 9 years ago

maybe we should just use something like: elementaryos.org/de or elementaryos.org/fr and then link to these pages? Would be a quick fix, even if that's really static :) Or what about http://i18next.com/ ?

jishnu7 commented 9 years ago

What about https://github.com/wikimedia/jquery.i18n ?

quassy commented 9 years ago

Using jQuery / Javascript in general for i18n sounds like a bad idea.

If the site uses PHP without frameworks I think it would be most sensible to use the built-in functions for gettext. Templates can stay almost the same, only that every to-be-translated <?php echo "English string"; ?> has to be replaced by <?php echo _("English string"); ?> (or <?=_( "English string" )?> if you prefer it short, and enable shortcodes). GNU gettext is pretty much standard and there are a whole bunch of (including web) apps for it, but you can also edit the files with a text editor if you feel desperate.

tajnymag commented 9 years ago

As a temporary solution I'd agree with PhillipSz with the "elementaryos.org/lng". We would also have it easier to use the translated strings later.

davidak commented 9 years ago

much projects use Transifex, like ownCloud https://www.transifex.com/projects/p/owncloud/

it is free for open source-project. the interface is more modern than launchpad. but why not using launchpad, if you use it for the apps?

also, the localization should happen on server-side that the client simply get's a plain html file. i hope you have caching like varnish to speed it up and don't have to apply the localization on every request. that saves lot's of resources on the webserver!

php gettext using a php extension seams to be the standard.

tl;dr http://stackoverflow.com/questions/12731105/is-gettext-the-best-way-to-localise-a-website-in-php-only-mild-localisation-ne http://mel.melaxis.com/devblog/2005/08/06/localizing-php-web-sites-using-gettext/ http://mel.melaxis.com/devblog/2006/04/10/benchmarking-php-localization-is-gettext-fast-enough/

tajnymag commented 9 years ago

But if we used the local manual translation, we could easily deal with currency convertion and translated "hero" screenshots.

inputsh commented 9 years ago

Please don't use Launchpad for the translation of the website. Choose Transifex or local translations. Both of them are much easier methods than the constant "something went wrong" errors we get on Launchpad.

lewisgoddard commented 9 years ago

Launchpad translations make no sense for a GitHub hosted project. They were never being seriously considered.

Murazaki commented 9 years ago

I understand that there is Weblate and WebtranslateIt that integrates well with Github (they are in the service hooks). Weblate is simple but seems to handle a lot of file types, and PHP files as well : http://docs.weblate.org/en/latest/formats.html#php-files

martpie commented 9 years ago

Laravel uses a nice system:

a template:

<?php echo trans('users.noaccess'); ?>

lang/fr/users.php:

return array(
   'noaccess'      =>   "Vous n'êtes pas autorisé à faire ça.",
   ...

);

still hardcoded in some ways, but it works pretty well. Just to give ideas.

emersion commented 9 years ago

Working on it, see #288