onOffice-Web-Org / oo-wp-plugin

onOffice for WP-Websites
https://wp-plugin.onoffice.com
GNU General Public License v3.0
9 stars 9 forks source link

P#71175 Simplify translations #236

Closed jmaas-onoffice closed 2 years ago

jmaas-onoffice commented 2 years ago

Current state

The plugin uses two different text domains for translations: "onoffice-for-wp-websites" and "onoffice". Most of the plugin uses "onoffice-for-wp-websites" but templates tand to use "onoffice".

The problem is that only strings in the "onoffice-for-wp-websites" text domain can be translated on the WordPress translation platform (https://translate.wordpress.org/locale/de/default/wp-plugins/onoffice-for-wp-websites/).

To translate strings from the "onoffice" text domains, we currently need to extract the strings into a .pot file, translate them in a .mo file, commit them to the repository and release them. This is a big overhead over the translation platform.

Desired state

  1. The plugin should only use the "onoffice-for-wp-websites" text domain.

    1. That means that all occurrences, in templates or elsewhere, of the "onoffice" text domain should be replaced with "onoffice-for-wp-websites".
    2. Since we have to update the translations, this should not immediately be released on stable, but first on development. This gives us the chance to update the translations before release and prevents customers seeing untranslated strings.
    3. A way to test this is to set the language to "Deutsch (Sie)" and open something in the frontend. Currently, because the templates use the "onoffice" text domain and there are no translations included for "Deutsch (Sie)", the strings appear in English. With this change, after it has been "officially" translated (instead of the included .mo files), the correct strings should appear.
  2. For backwards compatibility, the "onoffice" text domain should continue to be loaded and the existing files in the languages/ folder for the "onoffice" text domain should be kept. This allows existing templates to continue using the text domain, while allowing upgrading to the "onoffice-for-wp-websites" text domain.

LongTrong-exe commented 2 years ago

@jmaas-onoffice Is this issue and #235 the same?

jmaas-onoffice commented 2 years ago

@LongTrong-exe Looks like I copied the wrong text. I have updated it now. Thanks!