Cesco Posted December 15, 2017 Share Posted December 15, 2017 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 Link to comment Share on other sites More sharing options...
bernhard Posted December 15, 2017 Share Posted December 15, 2017 hi cesco, of course this is possible, maybe you have to refresh your file list (that caught me some time too): 1 Link to comment Share on other sites More sharing options...
Cesco Posted December 15, 2017 Author Share Posted December 15, 2017 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): Thanks @bernhard you save my time ... i feel so stupid 1 Link to comment Share on other sites More sharing options...
bernhard Posted December 15, 2017 Share Posted December 15, 2017 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... 1 Link to comment Share on other sites More sharing options...
Cesco Posted December 15, 2017 Author Share Posted December 15, 2017 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 Thanks Link to comment Share on other sites More sharing options...
HerTha Posted February 3, 2018 Share Posted February 3, 2018 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. Link to comment Share on other sites More sharing options...
bernhard Posted February 3, 2018 Share Posted February 3, 2018 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 1 1 Link to comment Share on other sites More sharing options...
HerTha Posted February 3, 2018 Share Posted February 3, 2018 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... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now