Jump to content

Recommended Posts

Posted

Hi 

 

is it possibile to translate some string like __('string') on _main.php neither on home.php ?

I don't see the possibility to translate the file on "File find to translate".

 

Thanks in advance

Francesco

Posted
59 minutes ago, bernhard said:

hi cesco,

of course this is possible, maybe you have to refresh your file list (that caught me some time too):

refresh.thumb.png.0e7128551cce23f592a6625e66fa7152.png

Thanks @bernhard you save my time ;)  ... i feel so stupid :)

 

 

 

  • Like 1
Posted
Just now, Cesco said:

Thanks @bernhard you save my time ;)  ... i feel so stupid :)

glad it helped. actually i think that the usability of this site/module could be improved. it was also not self-explaining for me when i did my first steps with multilanguage setups... ;)

  • Like 1
Posted
2 minutes ago, bernhard said:

glad it helped. actually i think that the usability of this site/module could be improved. it was also not self-explaining for me when i did my first steps with multilanguage setups... ;)

It comforts me :P

Thanks

  • 1 month later...
Posted

I wonder, is there some simple mechanism for translating a __('string') for a single language site?

I'd prefer to keep Multi Language Support disabled for now.

Posted

you can put a function somewhere in your code (eg _functions.php):

function translate($string) {
  if($config->lang == 'en') {
    $translations = [
      'hallo welt' => 'hello world',
      ...
    ];
    return $translations[$string];
  }
  return $string;
}

echo translate('hallo welt'); // hallo welt

$config->lang = 'en';
echo translate('hallo welt'); // hello world

 

  • Like 1
  • Thanks 1
Posted

Thanks @bernhard !

In my particular case, I have a few ocurences of __('en_string') which I would like to apper as translated 'de_string' in the output.

I could modify the source(s) replacing strings statically, but that would be rather "quick and dirty".

Hm, maybe I could substitute the __() function with my own version...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...