Laegnur Posted February 28, 2022 Share Posted February 28, 2022 Hello. I'm almost a new user in Processwire. Now I'm adventuring myself into make a new website with this CMS, and adding multi-language support to it. I installed the site using the blank profile, and install later the language support modules. Configure 3 languages, and add fields, templates and pages with translated labels, all correct. But now, I have 5 strings across multiple template files that I need to translate. When I go to one of the languages, and build the phrase index it appears to find all the strings but when search for translatable files, it only find 4 string. The problematic string is the "_x('Developed by', 'developer')". What I'm doing wrong with this string? 1 Link to comment Share on other sites More sharing options...
flydev Posted March 1, 2022 Share Posted March 1, 2022 Hi @Laegnur and welcome here. Your issue come from the fact that your translated strings are on the same line (I admit it could be tricky to spot on first instance if you are not used with ProcessWire). To understand better, please read this sentence : Quote Your translation function calls should be limited to one per line. The parser will not recognize more than one translation call per line so any additional calls after the first will be ignored by the parser. This is to ensure that you can adequately use comment descriptions (as mentioned earlier), as well as to ensure consistent and readable code. So to get it working, write the first line on two lines lol : <?php // i18n - copyright echo _x('All rights reserver', 'copyright'); ?> <!-- html markup - separator --> | <?php // i18n - developer echo _x('Developed by', 'developer'); ?> You can use of course the syntax you want, just keep in mind that the strings need to be on two lines. For more information about: https://processwire.com/docs/multi-language-support/code-i18n/ 2 2 Link to comment Share on other sites More sharing options...
Laegnur Posted March 2, 2022 Author Share Posted March 2, 2022 Hello That's what I get for not reading all the documentation. Thank you very much for clarifying this point. 1 Link to comment Share on other sites More sharing options...
wbmnfktr Posted March 2, 2022 Share Posted March 2, 2022 14 hours ago, Laegnur said: That's what I get for not reading all the documentation. I use ProcessWIre since 2014 (first real project with PW in 2015) but still that very little detail is even new to me. Never had such an issue - for whatever reason. But now I know. BTW... welcome to the ProcessWire forums. Hope you enjoy your stay and find whatever you are looking for! 1 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