• Resolved lawkwok

    (@lawkwok)


    Hi,

    Has anyone successfully localized a site using JS instead of plugins such as WPML or Polylang? I find those plugins overkill if you simply want to translate menu items, and button strings.

    One promising solution I’ve found is the “jquery-localize” project. It uses data attributes in HTML tags to target and replace strings, but I don’t think WooCommerce is able to insert that information into tags.

    I would love to hear how you guys have tackled this!

    https://wordpress.org/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    This forum is predominantly for technical support and debugging, so if you want feedback or suggestions from other store owners/developer, you might want to post on one of the Facebook user groups.

    – WooCommerce Help and Share

    – Advanced WooCommerce

    Danny Santoro

    (@danielsantoro)

    Automattic Happiness Engineer

    I haven’t done it through Javascript, but the best way would be to use either translation files or gettext filters in PHP.

    For translations that are more than a few words like entire language changes (or I guess you could use it for one or two), there’s a WooCommerce Localization Guide that will show you how to use a tool like Poedit.

    For single phrases or a handful of them you could use the gettext filter to code them in manually. If you want a quick and simple plugin to do that instead of coding it by hand, then check out Say What? – it should be a much lighter load on your site than via Javascript.

    Thread Starter lawkwok

    (@lawkwok)

    Ah thanks for all the information. I’ll check both your suggestions out.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Localization using JS’ is closed to new replies.