Juergen Posted November 21, 2021 Share Posted November 21, 2021 Hello at all, I am struggeling about a fast method to get all language translation CSV files of fe a module and merge all these files into 1 CSV file. I do not want fe 10 CSV translation files for a module. So I want to merge them all into one. All translation files for a site module are stored in site/assets/idoftheModule/... as json files. These translation files can be downloaded, but they are in json and not CSV format. I know I can do it one by one in the backend, but this is not my goal. Does anyone has done this before and could give me a hint, what ist the best and fastest way to 1) dowload all CSV files of a module at once and 2) merge them all into 1 CSV file. Thanks in advance 1 Link to comment Share on other sites More sharing options...
bernhard Posted October 18 Share Posted October 18 Hey @Juergen writing the docs for RockLanguage I did some research and found this old thread. I guess you were facing the challenge to ship your module with translations? Anybody facing the same problem please have a look at RockLanguage! All you have to do is add language mappings (eg german=DE) and then add a folder /RockLanguage/DE to your module. RockLanguage will then copy all translation .json files from /site/assets/files/.../...json to your module. And not only that. Once you translate a new string via the PW backend, RockLanguage will automatically copy the new json to your module's folder so you can just commit it to github 😎 1 Link to comment Share on other sites More sharing options...
Juergen Posted October 19 Author Share Posted October 19 Thank you @bernhard for your work!!!! This sounds very useful and I will try it out in the next time. 1 Link to comment Share on other sites More sharing options...
Juergen Posted October 26 Author Share Posted October 26 Hello @bernhard I have tested your module and it works very well!! Unfortunately it does not exactly what I want, because it imports json files. What I need is to get all language files of a module as csv, not json. The reason for this is that the language files of a module should be shipped as csv files inside the languages folder, so they could be imported by the user. So I am looking for an easy to use solution to get all all language files of a module as csv files. Then I use the command line interface to copy all these files into one. At the moment PW only supports the download of each csv file separately, which is very time-consuming. It would be great if there would be a possibiltiy to select if the language files should be imported as json or csv. This is only an idea for a request - I know you are very busy and if you do not agree with me, it is ok. Wish you nice weekend and thank you for all your work you have done till now for the community! Best regards Jürgen Link to comment Share on other sites More sharing options...
bernhard Posted October 27 Share Posted October 27 12 hours ago, Juergen said: So I am looking for an easy to use solution to get all all language files of a module as csv files. 12 hours ago, Juergen said: At the moment PW only supports the download of each csv file separately, which is very time-consuming. That's why I built RockLanguage. Yes, that means users have to install RockLanguage. I can't do anything about that unless the same functionality is in the core, which I'd prefer. But it's extremely light-weight and does not do any harm. https://github.com/baumrock/RockLanguage/blob/79bd3f996e3850361f2b41b149933a1a7bf20881/RockLanguage.module.php#L115-L121 Even if we had a way to export all CSV at once that would mean that every user using your module had to re-install translations whenever your module has new translations. Which is - again - tedious and time consuming. I simply don't like this approach and therefore will not build anything to support it. Imagine having 20 rock (or other) modules on a project (I often have more). Using CSV that would mean I'd have to install translations for 20 modules. Having 3 languages? Install 60 languages... Pulling updates for all modules? Install languages again... Using RockLanguage. Define the mapping once and you are done. I built RockLanguage because I think it's a far better workflow both for developers and for users. Thanks for trying it out and confirming that it works. 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