Translation doesn’t work. | WordPress.org

[ad_1]

Plugin Author
Tim W

(@timwhitlock)

With Loco Translation there is 100% System translation, but if I click Synchronize and then click Save, the translation shows 66%, why?

Possibly because 34% of the source strings are new, but I’d be guessing.

You should get a summary after Sync. What does it say?

New bold strings appear after Sync.

But maybe I found a solution: I didn’t sync the file but created (by Copy) a new personal file .po and I selected “Use this file as template when running Sync” and make the changes in this one, even though I click Sync keeps them 100%.
Is that correct?

  • This reply was modified 2 hours, 58 minutes ago by steve92.
  • This reply was modified 2 hours, 58 minutes ago by steve92.
  • This reply was modified 2 hours, 58 minutes ago by steve92.

Plugin Author
Tim W

(@timwhitlock)

The summary will tell you how many new strings were added during sync. This appears as a green success notification above the editor. What does it say?

Copying another file is fine as long as that file is in sync. Without knowing what you’re syncing to, I can’t comment on whether your solution is correct, or whether the post-sync state is incorrect.

If you look at the UpdraftPlus plugin, in the Languages directory there is the .pot file + all the available translations, but not the Italian one.
The Italian one is in the languages/plugins directory because I uploaded it by GlotPress. I don’t understand what’s going on.

  • This reply was modified 1 hour, 57 minutes ago by steve92.

Plugin Author
Tim W

(@timwhitlock)

Syncing the GlotPress PO to the author-provided POT shows the summary I mentioned as follows:

Merged from updraftplus.pot. 721 new strings added. 81 obsolete strings removed. 1 string marked Fuzzy

The extra strings being added explains why you see 66% translated.

Why does this happen? Because GlotPress doesn’t use POT files. It extracts its own source strings from the source code, and has decided there are only 1,507 strings as opposed to the 2,147 in the developer’s POT. Hence when you ask Loco Translate to update the PO with the supposedly correct strings, you get a load of new ones.

Which file is the correct one? It looks to me as if the author’s POT file contains references to strings which aren’t used because they’re in files that don’t exist (at least not shipped with the plugin). It also has strings missing that are clearly present in the code.

So your “solution” of copying the GlotPress PO file will indeed show you 100% instead of 66%, but whether it’s completely correct and contains all the strings you need, I can’t say.

You have probably checked UpdraftPlus free, the strings you can’t find are because they are in the Premium version.

We’re almost there. I downloaded the .mo and .po files from GlotPress (I uploaded them there) and put them in the languages/plugins directory and it gives me 100% translation for 2119 strings. If I click Sync it shows that it’s out of sync with the .pot file, but I think that’s not important.
So I didn’t click save, but created a custom .po file and translated from that. Then, when I finish the new translations, I upload the new version to GlotPress. It’s correct?

Plugin Author
Tim W

(@timwhitlock)

Yes, I tested with the open source plugin. This will be the same version that GlotPress has access to.

You’re in the best position to judge if the strings in your PO are correct. I’ve explained what’s going on and how sync works. The rest is up to you.

Okay. The most important .po and .mo files are the ones loaded into GlotPress and can be found in the languages/plugins directory.
Everything else is of little value. Now I understand, thanks.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer