Custom versus system
-
Hi
I have been using loco translate to change a number of terms in woo commerce and I was advised to make these changes in the custom file but I have ended up with a system and custom file and there is a string I want to change but for some reason it is in the system file but not the custom file and since I translate it, it has reverted back to the original string. The string is ‘We have finished processing your order.’ and feeds into a confirmation email.Can you help to confirm how I make sure all the strings are captured in the custom file I am editing?
ThanksThe page I need help with: [log in to see the link]
-
how I make sure all the strings are captured in the custom file I am editing?
You should ensure all PO files are synced to the WooCommerce POT file. The easiest thing to do is always click sync before making any edits to any PO file.
Hi, I have clicked sync but it says that only 69% of strings are translates in the custom file versus the system file is 99%? How do I get the custom file to include all the strings?
Syncing to the POT file only merges source strings, because POT files do not contain translations. If you want to merge translations from another PO file you have to use the copy function instead and select the options “Copy target translations” and “Use this file as template when running Sync”.
Note that it is not actually necessary for your custom file to be fully translated. Any missing translations will fall back to the system file. You only need to enter translations that you want to be different from the system file.
Hi – thanks for your response but I’m afraid I don’t follow what actions I need to take. Is it possible to confirm what I need to do when I am in the plugin, step-by-step?
My understanding is the system file is overwritten so translations you make in there won’t always be retained, therefore you need to make the translations in the custom file. The problem is that, the translation I want to make isn’t in the custom file so I can’t do the translation. I can however see it in the system file so not sure if there is a way of moving it into the custom file?
I am not familiar with coding etc so if possible to set out the steps that would be much appreciated.
Thanks
I don’t understand what the problem is.
there is a string I want to change but for some reason it is in the system file but not the custom file
Syncing your custom file should pull all available source strings from woocommerce.pot. The string “We have finished processing your order” is present in the current release. If that’s not working, I can’t say why.
I have clicked sync but it says that only 69% of strings are translates in the custom file versus the system file is 99%?
If you want to duplicate all of the installed translations in your custom file you will have to delete it and create a new one sing the copy function as I mentioned. But this is not necessary in order to translate the string you want to change.
Can you confirm how I should do the sync once in the custom file?
I have gone to here
Plugins WooCommerce woocommerce-en_GB.poand on the editor tab I am clicking sync but nothing changes.
I have typed the ‘We have finished processing your order’ string into the search box but a red cross comes up.
Thanks in advance
In case it helps this is what it says when i’m in the custom file
Updated: 29th March 2021 12:13 pm – 69% translated, 8,575 strings (12 fuzzy, 2,658 untranslated)
File info tab
File size: 1.5 MB File modified: 29th March 2021 12:13 pm Last translation: StreetHunt — 29th March 2021 12:13 pm Translation progress: 69% translated, 8,575 strings (12 fuzzy, 2,657 untranslated)What message do you get after sync? Even if nothing changes it should tell you what happened.
Have you checked woocommerce.pot to see if the string is in there?
After the synch it states – OK: Strings up to date with woocommerce.pot
How do I check the woocommerce.pot?
Click “Edit template” (above the file listing) to open woocommerce.pot
However, I can see from knowing the URL to this file that is not the same file that ships with Woocommerce. It looks like it has been synced to the source code using Loco Translate which is strongly recommended against unless you are the plugin author. It would have been useful to know this. Revert this file.
I suggest you start again from scratch. Download the full PO file from https://translate.wordpress.org/projects/wp-plugins/woocommerce/ and save it in the system location. Then copy this file (as per earlier links) to create your custom version and edit that.
Note that downloading the PO file is recommended because using the WordPress-installed version will not include the JavaScript translations. This is a known issue, but does not affect the specific string you are discussing.
I had no idea that it wasn’t the same file. The wordpress help have done things previously which must have changed it.
Ok on starting from scratch. Is there a way of extracting all translations I have made from the custom and systems files? I have done quite a lot so to start again without having this extract is going to be really difficult
I suggested starting from scratch this way because it looks like (1) you are in a mess, and (2) you wanted to copy installed translations rather than just add custom ones.
The way to keep existing translations is ensuring Sync works properly. This is what it does. It merges the available string definitions from the POT file into PO files without deleting translations that are still valid. That brings us full circle to your original problem that for some reason your custom files were not showing all available strings. Possibly that original problem was due to messing up the POT file, but I have no idea of the order of events.
I have completely lost track of what the problem is, or what state you are in. If you want my advice on a way out of this please post full details of what files you have, where they came from and what has been modified.
Problem – I need to translate the following string but don’t have it in my custom file
‘We have finished processing your order.’If my only option is to start again I can do that but my question was is there a way to extract all the translations I have put through so far (so that I can repeat in a new file as there are quite a lot)?
For background, I am very new to creating a website and have no tech background therefore I apologise I am struggling to understand when you reply with quite technical words etc. I had initially installed your plugin and then I had an issue with something not translating and wordpress help then changed way the files were set up – unfortunately I don’t know exactly what they did.
Files I have – I have provided details I think may be useful but if you need other details could you let me know which tab I should go on to give you what you need?
Screenshot of main woocommerce page – https://snipboard.io/NB1Lw7.jpg
Custom file – https://snipboard.io/YHhTXu.jpg
Custom file info – https://snipboard.io/86heGO.jpg
System file info – https://snipboard.io/cNbXxM.jpgI appreciate your help
Problem – I need to translate the following string but don’t have it in my custom file
‘We have finished processing your order.’This was the original problem.
With the correct woocommerce.pot file installed this should be a non-issue. We established this file had been altered, so fix that first. You have not said if you fixed this and your screenshots do not tell me.
Then (assuming no settings have been modified) any new file and any Sync operation will add the string “We have finished processing your order” into the editor for translating. I know this because it is present in the current version of WooCommerce’s woocommerce.pot.
Don’t proceed until you have this working.
If my only option is to start again I can do that but my question was is there a way to extract all the translations I have put through so far
As I have said, syncing PO files does not remove translations as long as they are still valid and your template setup is correct (see first point). Any changes you have made to system files however are at risk, because WordPress will overwrite them at some point. There is no quick and easy way (using my plugin) to move your edits to these files into an another PO file that already exists; you can only copy the system files to create new custom files using Loco Translate.
Saving your existing work on the custom file is easer. Just sync it, once you have sync working! If strings disappear during sync (and you have reinstated a valid template) then this is another issue that will take us off on a tangent. We can talk about that separately if relevant.
I had an issue with something not translating and wordpress help then changed way the files were set up – unfortunately I don’t know exactly what they did.
I don’t know what they did either, which makes helping you undo it rather difficult. Whoever “they” are, I suggest you ask them to undo whatever they broke before you do anything else.
The topic ‘Custom versus system’ is closed to new replies.