Okay
  Public Ticket #1045463
Change language woocommerce buttons
Closed

Comments

  •  2
    sai1234 started the conversation

    Hello,


    I have a homepage done with kalium. It's a webshop with Woocommerce in Japanese. Everything is fine except when I click on the cart icon it says "View cart, Checkout, Subtotal" in English. When entering View cart it also says as a header "Cart".

    Look at picture kalium1.jpg.


    Also when entering Checkout, it says <font size="small" color="gray"....  on the addressfield, and on the same page it also says "Payment method" in english. Look at kalium2.jpg.


    Best regards,

    Tobias

  • [deleted] replied

    Hi Tobias,

    Some strings of WooCommerce are contained inside Kalium theme files. In order to translate them go to translator plugin (such as Loco Translate) and choose Kalium theme to translate then search for these un-translated strings.

    We would really appreciate when you translate language file to send po/mo files so we will add Japanese translations to the list of supported languages.


    Here is a tutorial that shows you how to translate theme strings:

    To translate theme strings, you can do this via Loco Translate plugin. If you don't have this plugin, please install and activate it in your WordPress site.

    1. Then go to Loco Translate > Manage Translations

    2. Click "New Language" for the current active theme (if you didn't created it yet, otherwise ignore this step). On the new language page, choose these options – click here http://d.pr/119ES

    3. After that you will be redirected to the editing screen for theme translations. Before you continue with your translations make sure the current language of your site is selected – click here http://d.pr/i/18h0w

    4. Follow these instructions to learn how to translate strings – http://d.pr/i/1jsek

    5. The changes will be applied immediately – http://d.pr/i/1ju6w


    Note: Translation files will be saved to wp-content/themes/kalium/languages folder or global directory of theme translations: wp-content/languages/themes/ (based on your choice).

    If you have saved your translations inside theme folder, always save a backup of languages/ folder (inside the theme) when there is new theme update. After you update the theme (languages folder will be replaced with an empty folder), just move the backup files you previously saved to the same languages directory and your changes will still be applied.


  •  2
    sai1234 replied

    Hi Arlind,


    Thank you for the reply. The translation plugin worked great! However, I can't see any method how to fix my other concern about the text "<font size="small" color="gray"" showing up on the Address field at checkout (to the left on the picture), according to picture kalium2.jpg. How can I fix this?


    Best regards,

    Tobias

  • [deleted] replied

    Hi sai1234,

    Have you added some custom code to the theme which modifies the display text on field.

    Alternatively you can replace the placeholder text on that field with this code (functions.php):

    // Hook in
    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields_address_field' );
    // Our hooked in function - $fields is passed via the filter!
    function custom_override_checkout_fields_address_field( $fields ) {
         $fields['billing']['billing_address_1']['placeholder'] = 'My new placeholder';
         return $fields;
    }
  •  2
    sai1234 replied

    Hello again,


    No, I have not added custom code.


    Sorry, I don't have so much knowledge about this but, Is it the functions.php in the wp-content/themes/kalium? If yes, I have added the code with no result.


    Best regards,

    Tobias

  • [deleted] replied

    Hi Tobias,

    I am sorry that it didn't worked. I need to try by myself and fix this issue.

    Can you please share your WP credentials here. Your information is safe here (private) in this thread.

    To include your credentials click Insert Credentials button in editor toolbar. (See how)

  •   sai1234 replied privately
  • [deleted] replied

    Hi Tobias,

    I have managed to fix this issue. What I did is modified a bit the code I gave you previously to:

    // Hook in
    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields_address_field' );

    // Our hooked in function - $fields is passed via the filter!
    function custom_override_checkout_fields_address_field( $fields ) {

    $fields['billing']['billing_address_1']['label'] = strip_tags( $fields['billing']['billing_address_1']['label'] );
    return $fields;
    }

    And now the address in billing field is showing good formatted input:


    (view large version)

    Note that if you update the theme, you have to re-add that code in functions.php