Translate
-
Hey, how about translations? It will be right here on ww.wp.xz.cn?
thank you for the info
-
Sorry, this plugin currently doesn’t support translation/i18n.
I took on the task of making your excellent plugin translation-friendly. It took me literally an hour. Not sure it’s perfect, but it’s a start. I can email it to you for review if you’re interested, Janis.
French translation as a bonus.Let me know.
While I appreciate the effort, are you sure you got all of the strings that would need translation? A lot of the UI text is in JavaScript/TypeScript files.
@physalice Wow, that would be cool. 🙂 If it were then added, and it was not translate. I’m also the PRO version. Would that then be integrated?
@janis Unfortunately no, that part had escaped me. I looked into it but your way of enqueuing and registering scripts via an auto versioned function puzzles me quite a bit, so that’s where my limited development skills reach their limits.
I guess I can still send you my work in case you ever want to work on full i18n support, that’ll save you at least all the php strings, but it is indeed quite incomplete. Although if we can work together in order to implement wp localize script in your auto versioning, I feel confident I can scan the JS and save you the chore. But that doesn’t solve the TypeScript part that I have no idea how to translate.
@michal As mentioned, my version seems to be incomplete so I’m not sure it’s worth sending anything yet :).
I looked into it but your way of enqueuing and registering scripts via an auto versioned function puzzles me quite a bit […]
It’s actually pretty simple. The only thing that the auto-versioning function does is ensure that the
?ver=123query parameter in the script URL changes whenever the script file changes. It saves me from having to manually update version numbers every time I edit a script. (Normally you need to update the version to make sure the browser will load your changes instead of using a cached copy.)In all other ways these functions work exactly as their
wp_register_*/wp_enqueue_*equivalents. They don’t affect localization in the slightest.That said, there might be a different complication: the plugin uses
wp_localize_scriptextensively to pass various configuration details to JS (AFAIK, WordPress doesn’t provide a more suitable API for this purpose). Implementing actual localization without breaking this pre-existing code could be a bit tricky.But that doesn’t solve the TypeScript part that I have no idea how to translate.
Technically, TypeScript is a superset of JavaScript, so any approach that works in JavaScript should also work in TypeScript.
I guess I can still send you my work in case you ever want to work on full i18n support, that’ll save you at least all the php strings, but it is indeed quite incomplete.
Sure, why not. My email is
[email protected]
The topic ‘Translate’ is closed to new replies.