Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate database direct output #21

Closed
thierryve opened this issue Mar 11, 2014 · 7 comments

Comments

@thierryve
Copy link

commented Mar 11, 2014

I noticed that there are some items like yes, no, website, service (on the server page) that are not translated. This because it is direct database output. I've looked at the project and came up with a couple solutions;

  • concat in MySQL CONCAT('{label_', email, '}') AS email
  • Edit string in for loop $servers[$x]['email'] = "{label_".$servers[$x]['email']."}"
  • Handling the translation in the template with something like {label_{email}} (I think this only works in tpl_repeat blocks because the template is parsed twice)
  • Translate with something like $servers[$x]['email'] = $this->translate($servers[$x]['email']);
  • Modify Template.class.php with a specific translation tag that is run just before outputing the html.

Maybe you have a better solution :D

Tell me what you prefer and I will take a look at changing it and create a pull request

@dopeh

This comment has been minimized.

Copy link
Member

commented Mar 11, 2014

Hi Thierry,
There is a function called "psm_get_lang" which basically does the $this->translate() from your example, like so:
$servers[$x]['email'] = psm_get_lang('system', $servers[$x]['email']);

If you have some time to implement that, that would be much appreciated. Please add it on the develop branch.

Regards,
Pep

@dopeh dopeh added bug and removed bug labels Mar 11, 2014
@dopeh dopeh added this to the 2.2.0 milestone Mar 11, 2014
@thierryve

This comment has been minimized.

Copy link
Author

commented Mar 13, 2014

I will implement this, I saw that not all translations are available. I can add them in English and Dutch but unfortunately I don't speak the other languages. What do you prefer?

@dopeh

This comment has been minimized.

Copy link
Member

commented Mar 13, 2014

I usually just add new labels in English to all language files, eventually someone will come along and correct them.

@dopeh

This comment has been minimized.

Copy link
Member

commented Mar 19, 2014

Just wondering what the status is of this issue. I am trying to plan the next 2.2 release, so depending on when you could finish this I may or may not include it in the 2.2 release. Otherwise it will come in the next patch release (2.2.1) with some other small issues.

@Abawell

This comment has been minimized.

Copy link
Contributor

commented Mar 24, 2014

Otherwise Thierryve, I could do it quickly if you do not have time.

@Abawell

This comment has been minimized.

Copy link
Contributor

commented Mar 26, 2014

I did it. And much more.

@dopeh dopeh added duplicate and removed bug labels Mar 26, 2014
@dopeh dopeh removed this from the 2.2.0 milestone Mar 26, 2014
@dopeh dopeh self-assigned this Mar 26, 2014
@dopeh

This comment has been minimized.

Copy link
Member

commented Mar 26, 2014

Has been implemented in #39

@dopeh dopeh closed this Mar 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.