Coder Social home page Coder Social logo

Comments (13)

 avatar commented on June 2, 2024

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

from website.

danirabbit avatar danirabbit commented on June 2, 2024

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?

from website.

PhillipSz avatar PhillipSz commented on June 2, 2024

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/ ?

from website.

jishnu7 avatar jishnu7 commented on June 2, 2024

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

from website.

quassy avatar quassy commented on June 2, 2024

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.

from website.

tajnymag avatar tajnymag commented on June 2, 2024

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.

from website.

davidak avatar davidak commented on June 2, 2024

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/

from website.

tajnymag avatar tajnymag commented on June 2, 2024

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

from website.

inputsh avatar inputsh commented on June 2, 2024

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.

from website.

lewisgoddard avatar lewisgoddard commented on June 2, 2024

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

from website.

Murazaki avatar Murazaki commented on June 2, 2024

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

from website.

martpie avatar martpie commented on June 2, 2024

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.

from website.

emersion avatar emersion commented on June 2, 2024

Working on it, see #288

from website.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.