PHP or JS Translation

1

I have a one page, where I must perform translation. At first I was thinking of translating with JS, to do something dynamic, that is, the person would click the button, I would call a .json file and perform the translation.

But then I found the php-gettext library, which performs what I want to do, but passing the parameter through the URL, as I use iframe, complicates the manual change to the language the person wants, in the given situation.

I have tested the library and it works well, and the important thing is that there is the poedit program that facilitates the translation. But I have a problem, I make new updates in time. That way I will have to update the main files and the rest.

1st - Is there a button in poedit for me to update the whole .pot file, without losing the existing functionality, as well as the .po of the translations already done?

  

* Checking poedit, it has an option where I can update the .po file through the updated .pot without losing translations.

2º - If you do not have it, what indication would you make so that I can translate my site, what do you think of the option with javascript. Do you think it's feasible?

3rd - Is there any easier way?

    
asked by anonymous 25.08.2016 / 00:34

1 answer

1

You can create a .POT file by Poedit itself to maintain it as the "main" catalog. The cool thing is that by the program itself you can have it scour the source code behind the new terms in the source code. From there, you can always update your .PO file from .POT, which keeps all the translations you have already done.

I think this is a very efficient way to internationalize any application in PHP.

    
25.08.2016 / 04:59