• Resolved Yordan Soares

    (@yordansoares)


    Hi,

    I have translated the description from this plugin (and also the one from AR for WordPress) into Spanish. However, I have realized that both plugins are not well internationalized, so I can’t translate the plugins itself. If you want to make your plugins ready to translate, you may want to read this article from the official plugin developer’s Docs: How to Internationalize Your Plugin

    Hope it helps to make your plugins even better!

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author webandprint

    (@webandprint)

    Thank you for your message and advice. I would love it if you translated my plugin.

    I have started internationalising the AR for WordPress plugin and wanted to ask you to take a look at it and makes sure I am doing it correctly.

    Here is the AR for WordPress plugin you can download with the model editing page internationalised. Would you be so kind as to check that this is what you need and I will then internationalise the rest of the plugin and the AR for Woocommerce plugin and add these versions to the WordPress plugin repository.

    https://augmentedrealityplugins.com/plugins/ar-for-wordpress-intl.zip

    With thanks,
    Nick

    Thread Starter Yordan Soares

    (@yordansoares)

    Hi @webandprint,

    That’s great! I have tested the version above, and it seems that you’re doing the internationalization correctly:

    A screenshot that display a screenshot from the plugin partially translated into Spanish

    There are some strings not internationalized in this screen, but I think you only wanted to know if you were doing it right to continue working on it ??

    Let me know when you think you have finished, so I can start translating the plugin!

    Plugin Author webandprint

    (@webandprint)

    Hi Yordan,

    Thanks so much. I have just released an update for both “AR for WordPress” and “AR for Woocommerce” to versions 2.2.7

    The update includes internationalisation across all screens – hopefully ??

    I would be very appreciative if you could translate them and let me know if there is anything missing.

    Thanks once again.
    Nick

    Thread Starter Yordan Soares

    (@yordansoares)

    I have translated AR for WordPress into Spanish!

    However, I found some strings not internationalized:

    1. ‘Settings’ (both 2nd and 3rd parameter): ar-wordpress.php#L44
    2. ‘AR Image’ (missing 2nd parameter: text domain): ar-wordpress.php#L53
    3. ‘AR Logo File’ (button value): ar-functions.php#L1393
    4. ‘(JPG file 250 px x 250px)’ (I’d rewording this text like this ‘(JPG file 250px × 250px)’): ar-functions.php#L1405
    5. ‘QR Logo File’ (button value): ar-functions.php#L1406
    6. ‘Premium Plans Only’ (wrong text domain, you could add a condition to display the right text domain, as you did in other places, like here ar-functions.php#63): ar-model-fields.php#L75
    7. ‘In’: ar-model-fields.php#L146
    8. ‘Default’ (option): ar-model-fields.php#L147
    9. ‘Out’: ar-model-fields.php#L156
    10. ‘Default’ (option): ar-model-fields.php#L157

    Also, replace the line in ar-wordpress.php#L65 with this one:

    $columns['thumbs'] = '<div class="ar_tooltip"><img src="' . $ARimgSrc . '" width="15"><span class="ar_tooltip_text">'.__('AR Model', 'ar-for-wordpress' ).'</span></div>'; //name of the column

    You don’t need to internationalize the whole line, also the i18n functions are not compatible with variables (learn more), use sprintf() or printf() instead, when you need to do this.

    Let me know when you have updated this, so I can complete the translations for these strings to have Spanish 100% translated ??

    P.S.: I’ll take care of the translations for AR for WooCommerce later!

    Plugin Author webandprint

    (@webandprint)

    Wow! Thanks so much. I have fixed the remaining phrases and pushed out v2.2.8 of the plugins.

    I am so grateful that you are taking the time to translate them and be so helpful.

    Muchas gracias amigo! ??

    Thread Starter Yordan Soares

    (@yordansoares)

    Thanks for updating the plugin! I already translated the missing strings, and now almost all the texts are translated, except 1 non-internationalized string, that I didn’t see when I review the code the last time (sorry for that!):

    The good news is that, when you update this string in the next release, it will be translated automatically, so no hurry! ??

    P.S.: I’ll try to translate AR for WooCommerce tonight!

    Plugin Author webandprint

    (@webandprint)

    Thank you!

    I have just updated the missing value for AR For WordPress and also a couple I missed for AR for Woocommerce in the repository. I have left the version numbers as is for now.
    ??

    Thread Starter Yordan Soares

    (@yordansoares)

    Perfect! I just checked, and AR for WordPress is completely translated into Spanish ?? (Spain, Colombia, and Venezuela)

    I just tried to translate AR for WooCommerce, but I realized that the Translating WordPress site is not detecting the plugin’s strings because you haven’t loaded the text domain (as you did with AR for WordPress here).

    This is necessary since you have set 3.7 as Requires at least here, but as your plugin is in the www.ads-software.com plugin directoy, if you set the minimun version to 4.6, you no longer need to use load_plugin_textdomain(). See Loading Text Domain.

    Choose the path you like the most, and let me know when you update the plugin!

    Plugin Author webandprint

    (@webandprint)

    Line 10 of ar-woocommerce.php has the text domain.
    I have changed the requires value for both plugins to 4.6 and updated them.

    Thread Starter Yordan Soares

    (@yordansoares)

    Yes, that’s the text domain, but when you have a lower version than 4.6 set as Requires at least, you also need to load it using the load_plugin_textdomain() function.

    Anyway, your last changed should fix this issue, let’s wait until the Translating WordPress site detect the change ??

    Thread Starter Yordan Soares

    (@yordansoares)

    Hi @webandprint,

    It seems that still missing an extra change, before Translating WordPress is able to find the internationalized strings. Could you please replace 2.8.1 with trunk here: readme.txt#L7

    Stable tag is intended to tell www.ads-software.com which is the stable release, this way, you could be working in the next release even sending pulls, but until you don’t change this value, www.ads-software.com will be serving the stable version, or trunk if this doesn’t exist, which is your case. However, GlotPress, the system behind Translating WordPress, seems not to be as smart as WordPress Plugin Directory yet, and doesn’t search in trunk as a fallback, unless you explicit set this there.

    Also, I think it won’t hurt loading the text domain with load_plugin_textdomain() after ar-woocommerce.php#L20, to allow loading not only translation from https://translate.www.ads-software.com/, but also manual translations:

    add_action( 'plugins_loaded', 'ar_woo_load_text_domain' );
    function ar_woo_load_text_domain() {
        load_plugin_textdomain( 'ar-for-woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
    }

    In fact, I added that exactly code to your plugin, in a staging site, to test the translations that I already did ??

    Plugin Author webandprint

    (@webandprint)

    Thank you for your very comprehensive help with this. It is greatly appreciated.

    I have just updated the ar-woocommerce.php file to include the loading of the text domain. The Readme.txt file I have has the stable tag set to 2.2.8, i have pushed the file through again just in case.

    Thread Starter Yordan Soares

    (@yordansoares)

    Hi @webandprint,

    I have translated AR for WooCommerce into Spanish!

    However, I found some strings with i18n issues:

    1. ‘AR Models’ – Wrong text domain (‘textdomain’ instead of ‘ar-for-woocommerce’): ar-model-fields.php#L15
    2. Replace the line in ar-model-fields.php#L60 with this one:

      'label' => '<img src="'.esc_url( plugins_url( "assets/images/ios.png", __FILE__ ) ).'" style="height:20px; padding-right:10px; vertical-align: middle; ">' . __( 'USDZ 3D Model', 'ar-for-woocommerce' ),

    3. Replace the line in ar-model-fields.php#L67 with this one:

      'label' => '<img src="'.esc_url( plugins_url( "assets/images/android.png", __FILE__ ) ).'" style="height:20px; padding-right:10px; vertical-align: middle; ">' . __( 'GLB/GLTF 3D Model', 'ar-for-woocommerce' ),

    4. ‘Upload Skybox File’ – Non-internationalized yet: ar-model-fields.php#89
    5. ‘Upload Environment File’ – Non-internationalized yet: ar-model-fields.php#102
    6. ‘Scale Y’ – Text domain typo (‘ar-for-oocommerce’ instead of ‘ar-for-woocommerce’): ar-model-fields.php#L156
    7. ‘AR Logo File’ – Wrong text domain (‘ar-for-wordpress’ instead of ‘ar-for-woocommerce’) :ar-functions.php#L1393
    8. ‘QR Logo File’ – Wrong text domain (‘ar-for-wordpress’ instead of ‘ar-for-woocommerce’) :ar-functions.php#L1406

    I think that with these changes, your plugin will be 100% internationalized!

    Let me know when you have updated it, so I can finish the translations for these strings too ??

    Plugin Author webandprint

    (@webandprint)

    Thank You!!!

    I have just updated the missing strings and pushed the files through so hopefully it is now fully internationalised.

    If I have missed anything else please let me know.

    Thank you once again!

    Nick

    Thread Starter Yordan Soares

    (@yordansoares)

    Hi @webandprint,

    Sorry for the very late reply!

    Yes, it is! Also, I finished the missing strings, now both plugins are fully internationalized and translated into Spanish: Well done!

    Have a nice weekend!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘About the internationalization of the plugin’ is closed to new replies.