Comments (13)
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.
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.
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.
What about https://github.com/wikimedia/jquery.i18n ?
from website.
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.
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.
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.
But if we used the local manual translation, we could easily deal with currency convertion and translated "hero" screenshots.
from website.
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.
Launchpad translations make no sense for a GitHub hosted project. They were never being seriously considered.
from website.
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.
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.
Working on it, see #288
from website.
Related Issues (20)
- Make nav-bar sticky to for easy acces to user HOT 2
- Slack link for translation is broken
- Add Persian translation HOT 3
- Update Weblate to latest version HOT 1
- Facebook button links to a non-existent website HOT 1
- Web interface for Issue triage HOT 4
- Translations join chat link issue HOT 2
- Responsive Navbar for Mobile Sizes HOT 4
- Upgrade Node HOT 7
- adding dark theme feature HOT 2
- ElementaryOS 6.1 ISO is marked as RC? HOT 2
- Migrate to the latest stripe checkout HOT 7
- Use Stripe Receipt Emails HOT 1
- Document refund policy
- Installation guide recommends Etcher, but Etcher only shows a white screen on elementary OS HOT 1
- Old documentation link in causes confusion in Get Involved (Design) section HOT 7
- HTML theme-color doesn't match the pages
- Create an easy setup with docker for those who contribute HOT 2
- The team page doesn't show any members HOT 4
- Allow verification of the OS download via the website itself HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from website.