-
AuthorPosts
-
October 11, 2014 at 11:17 am #123528
.
October 11, 2014 at 11:20 am #123529I am sorry, but this was not a very helpful answer. Could you please give me some simple step by step instructions on how to make the ordinary swedish woocommerce translation – which works with all other themes – also to work with X? I am using wordpress 4.00 and woocommerce 2.2
October 11, 2014 at 4:19 pm #123590Hi there.
There is a solution for everyone that does not give up…
1)I did not understand how to use the default.po. But at last I got a clue from post #12883, which simply states that after having set WP_LANG, I need to rename the default.po to the desired language: In my case to wp-content\themes\x\framework\lang\sv_SE.po. Editing this file now with a program called poedit, I was able to set language to swedish and change some few translations. Anything referenced with __x__ in the woocommerce duplicates under X theme is going to be translated from this file once it has been renamed.2)default.po contains some 1367 lines. Nobody in his right mind will sit down and patiently re-translate this as it has been done already – and the translations are in wp-content\languages\plugins\woocommerce-sv_SE.po. What I did was to copy woocommerce-sv_SE.po to wp-content\themes\x\woocommerce, open in poedit set base path to “.”, and path to “.” and keywords to “_e” and “_” and run “update from sources”. This commented out everything that was not found in the woocommerce plugin. I guess most of the translations in the x plugin are just admin stuff anyway. So, next step was to remove all comment lines – which is done easily in notepad++ with the regex ^[#;].* Now, after a little more editing I had a very small woocommerce-sv_SE.po file with only the translations I needed for woocommerce in X. The trick now was to merge this with the sv_SE.po. (See http://www.marketpressthemes.com/blog/how-to-merge-two-po-files-using-poedit/) Using poedit this is done by “Update from POT file…”, Setting file mask to *.* and importing sv_SE.po into the very short woocommerce-sv_SE.po. Finally, woocommerce-sv_SE.po can be copied on top of sv_SE.po. -The only differences that were made are placed, actually in bottom of the file.
Seems to work so far. Wished you X people would have at least split up the default.po. Probably not a bad thing for performance. Or maybe I can do that now?
October 12, 2014 at 2:28 pm #123839Hi KJetil,
X is translation ready, but not yet translated. It’s user responsibility to translate their site to their preferred language. Copying existing files should work as you did, or you can just create new file. As long as the translation you’re looking is there then it should be okay.
You can merge or split your po files as long as they are still inside the allowed language path. Merging is better for using one default language, while multiple files is best for multiple language of course. Still, it should be your choice 🙂
Glad it works. Cheers!
-
AuthorPosts