OllieMackJames Posted July 11, 2015 Share Posted July 11, 2015 OK, just spent and lost a couple of hours getting translation to work for processwire working wit stuff like: <?php echo __('Slogan') ?> and then in setup language make alternatives for those files Then I set the profile language to the new one and all works great. Forward 2 hours of changing all stuff in files and then check the site on a different computer and I only see the old stuff! When logged out on the computer I was working on, same stuff happens. Wow, that is interesting... What I have is a number of static texts that need changing templates so that VISITORS see the correct text. I use same design for different sites/domains for different countries I want to make the design changes on one site and then just roll out. Apparently the processwire language module that I used is not for that. Much appreciated if someone could tell me how to do this. It is about stuff like domain name = domein naam add to cart = in winkelwagen must see = aanbevolen etc. etc. These terms will be used in different templates so it would be best if I could specify all this stuff in an external file that has different language versions. Then in one place in a sort of globals.php file I would include this file or the other language version. Anybody know how to do this? I am a happy user of pw, but programming is beyond me, copy paste I know. Thanks for any help Link to comment Share on other sites More sharing options...
LostKobrakai Posted July 11, 2015 Share Posted July 11, 2015 The language shown to anonymous visitors is always the language, which is set in the "guest" user. So if you don't want them to see the default language go edit this user to your preferred default language. You could also use the language already installed when enabling language support and just change the label. The "default" language is mandatory and cannot be deleted, therefore you can just use it as your "main" language, even if it's not english. 1 Link to comment Share on other sites More sharing options...
OllieMackJames Posted July 11, 2015 Author Share Posted July 11, 2015 The language shown to anonymous visitors is always the language, which is set in the "guest" user. So if you don't want them to see the default language go edit this user to your preferred default language. You could also use the language already installed when enabling language support and just change the label. The "default" language is mandatory and cannot be deleted, therefore you can just use it as your "main" language, even if it's not english. Thanks, that should do it, I already made an external language.php file where I added the $domain_name = "domein naam" etc. etc This seems to work fine except when within functions in other php files, then the $domain_name throws an unknown variable for $domain_name Anybody know how to do this, except to go into the functions themselves and specify there as well. Thanks! 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