• Skip to primary navigation
  • Skip to main content

BookingWP™

WordPress Appointment Booking Plugins for WooCommerce

  • Get Appointments
  • Contact
  • My Account

Translations of Bizznis child theme

Home › Forums › Deprecated › Bizznis

Log in
Bizznistopic-2450topic-2473
  • Jonathan Fokker
    Customer
    11 years, 5 months ago

    I am developing with Bizznis.

    The translation file en_US.po in child theme master doesn’t have translations ready for e.g. Search text and Breadcrumb text.

    How do I do that?

    Does there need to be some gettext quotes in the sources files?

    Would love to hear your feedback.

    Jonathan Fokker
    Customer
    11 years, 5 months ago

    OK I did see that the .po file of all text is in Bizznis theme folder under lib/languages.

    I can translate the desired text and put an .mo file there.

    But what happens when I upgrade Bizznis? Then everything will be overwritten.

    I see .po in child theme but there are only a few text strings.

    When I put .po from Bizznis in childtheme folder and create a .mo there it doesn’t work either.

    I have this in my functions.php for localization:

    //* Set Localization (do not remove)
    load_child_theme_textdomain( 'weydelandNL', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'weydelandNL' ) );

    What can I do?

    Zeljan Topic
    Support
    11 years, 5 months ago

    I see your point.

    As Bizznis is a parent theme, you can override every file with your child theme, language files included. Here’s what you have to do in order to keep your Bizznis powered website translated even after updates.

    1. Go to your active child theme folder and create a folder called languages.
    2. Upload your translation files (your .mo and .po files) to the languages folder you just created.
    3. Next up, we need to tell Bizznis we want it to look for translation files in your Child Theme folder instead of the Bizznis folder. We need the following code pasted in your Child Theme’s functions.php:
      // Child Theme Language override
      define('BIZZNIS_LANGUAGES_DIR', STYLESHEETPATH.'/languages');define('BIZZNIS_LANGUAGES_URL', STYLESHEETPATH.'/languages');

    4. This snippet needs to go before the following code:
      load_template( get_template_directory() . '/lib/init.php' );

      but after the opening

      <?php

     

    That’s it. Now your site will always remain translated. Do keep in mind that a bigger Bizznis update (e.g. from 1.0.x to 1.1) will probably contain new untranslated texts in the new Bizznis .po file found in the /lib/languages/ folder.

    Jonathan Fokker
    Customer
    11 years, 5 months ago

    Thanks that worked.

    But I think there is a bug. I tried to translate the 404.php text in Poedit.

    I get this error in Poedit: A format specification for argument 1 doesn’t exist in ‘msgstr’

    It’s related to this message string

    #: ../404.php:20
    #, php-format
    msgid ""
    "The page you are looking for no longer exists. Perhaps you can return back "
    "to the site's homepage and see if you can find what you "
    "are looking for. Or, you can try finding it by using the search form below."
    msgstr ""
    "Helaas, deze pagina bestaat niet. Gebruik het menu op deze pagina om te "
    "vinden wat u zoekt. U kunt ook in de zoekbalk hieronder uw zoekopdracht "
    "invullen. "

    I think it has to do with the % symbol in there. Because there is a % symbol in 404.php we get a problem with translation?

    Greetings,

    Jonathan

    Zeljan Topic
    Support
    11 years, 5 months ago

    I’ll look into this. Thank you for reporting it.

    Zeljan Topic
    Support
    11 years, 5 months ago

    Nothing is wrong with the original string itself, but your translated string is missing this in it:

    homepage

    Add it somewhere in your translation and it should work. Of course, you can translate the ‘homepage’ text, but add the rest of it.

    Jonathan Fokker
    Customer
    11 years, 5 months ago

    OK thanks. That did the trick.

    How do I translate the “Search this website” text in the search bar?

    It’s not in the .po files.

    I know its in lib/frontend/search.php.

    Greetings, 

    Zeljan Topic
    Support
    11 years, 5 months ago

    You have a sharp focus :) …

    Fixed it and will add it to next theme release. In the meantime, replace this inside lib/frontend/search.php:

    esc_attr__( 'Search this website', 'bizznis' )

    with this:

    __( 'Search this website', 'bizznis' )

    In other words, just delete second “esc_attr” on line 15.

    Jonathan Fokker
    Customer
    11 years, 5 months ago

    OK.

    But this have an effect on the .po file in the Bizznis languages folder. I needed to add the string in there, which I did.

    I see you already added this to Github, otherwise I would have done it:) Thanks again!

    First website on Bizznis is almost ready:) Will send you link when done.

    Zeljan Topic
    Support
    11 years, 5 months ago

    Great. Please share ;)

    anistour
    Customer
    10 years, 4 months ago

    bonjour
    comment installer la bar de traduction comme la version demo

    merci

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.

Follow @bookingwp 900+ followers

  • About
  • Blog
  • Support
  • Terms
  • Privacy

© BookingWP™