ecleese / plexWatchWeb

A web front-end for plexWatch.
254 stars 40 forks source link

Translation Support #26

Open ecleese opened 11 years ago

wilpig commented 10 years ago

This is something that i've used in another project that makes the translation pretty easy. First add this as a function that every page will read.

function __($string){
    if(extension_loaded('gettext')){
        return _($string);
    }else{
        return $string;
    }
}

Next you'll encase any strings that you want translated by doing this:

__("Text to translate here")

That will invoke the gettext function and translate it if you have the capability and the translation files are available. Last you need the actual translations, crowd source it! http://www.getlocalization.com/ You can tie your github repo to them directly and it will update automatically when you commit new code. There is a little more to it but this is a suggestion. Nice work btw it gave me some insight as to which of my friends use my server that I was curious on.

Arcanemagus commented 9 years ago

It looks like this might be the way to go for a free project: https://poeditor.com/features/

1000 string limit, but I think we would still be fine with this.