Sorry, we don't support your browser.  Install a modern browser

Donor Dashboard should be fully translatable with Loco Translate and other translation plugins#17

Currently, the donor dashboard is translatable using custom PHP and JavaScript, but in some cases (or potentially every case) is not translatable by commonly used translation tools like Loco Translate.
It should be translatable.

(Migrated from featureOS: https://givewp.featureos.app/p/donor-dashboard-should-be-fully-translatable-with-loco-translate-and-other-translation-plugins)

5 years ago
C

Josh Pruitt via Priority Support I would like to know if it’s possible to translate the donor dashboard using wpml.

24 days ago
C

Our team is having a look at this.

24 days ago
C

Piotr Radzikowski via Priority Support

24 days ago
C
24 days ago
C

Pawel Orpik via Priority Support

24 days ago
55 comments hidden
C

Geneviève K.: +1

24 days ago
C

From the Loco Folks, via another thread: Tim W wrote: There is no simple solution if you are a novice. WordPress’s new-ish JSON translation system is ill conceived and fragile. I will try to explain why in the simplest terms I can, but depending on where your problem lies this may be best handed back to to the GiveWP developers. The file names for .json files are derived from the .js scripts which use them. This means that the software generating the .json files must produce the exact same result that WordPress does when the .js script is added to your page. In the case of Loco Translate (and probably other PO editors) the .js file reference is read from the .po file. It then imitates as closely as possible what WordPress would do if this script was queued for loading into your page. Why wouldn’t it work then? Because (1) the file reference could have been extracted from a different file than the one you load into your page, or (2) there could be a difference in the way the paths are expressed (see example below), or (3) some filter could be modifying your script paths, or (4) any one of infinite possible reasons two values could be computed differently. Ultimately the file editor (json compiler) doesn’t execute the code of your website to see what it’s going to do and cannot reliably predict the result. Here’s an example thread from last week: Strings from Javascript not translated. The root cause here was that the author was queueing their .js file using a relative path that differed from the one in the .po file. But they both point to the same file!! Yes. “foo/bar.js” and “foo/baz/../bar.js” point to the same file but they are not the same and will produce different .json file names. Hence the JSON loader is a terrible system. WordPress makes one allowance for differing .js file references. You are allowed “foo.min.js” which will be normalized to “foo.js”, but that’s it. If you want to do more than this you can use a filter. So what can you do about your problem? Debugging your site is the only way to find out what’s going on. If you are not able to do this then you are stuck. I suggest using the load_script_textdomain_relative_path to log every script that is queued and the relative path that is derived. Then find your script in the log and check if it matches the reference in the .po file. If you identify a mismatch in the relative paths, then you can use the same filter to fix the problem. Loco Translate observes this filter too, so normalizing the relative path here should take effect for both the .json compilation and also the runtime script loading. If you find in your investigation that Loco Translate is generating the wrong .json file name and you think this is fixable, then please report it as a bug in a separate thread.

24 days ago
C

Jason via Priority Support: Reported this.

24 days ago
C

Steps to replicate: - Have the donor dashboard set up and at least one donation that will allow you to see the donor dashboard - Use this gist https://gist.github.com/kjohnson/6f3016737efc6e03f4071575e7d839f8 to translate Your giving Stats - it will work - Use the same gist to translate Edit Profile. It will not work Loco translate does not work for any string.

24 days ago
C

Hey friends!

We’re looking into this one again to see if its still an issue.

Thanks again for your feedback and patience 🙂

24 days ago
C

Any new UPDATESSSSSSSS? please

24 days ago
C

Stefan Bender via Priority Support

24 days ago