Skip to:
Content
Pages
Categories
Search
Top
Bottom

language file(s) ignored


  • lukascech
    Participant

    @lukascech

    Hi,

    I have upgraded a year old site that is using Buddypress and lost all translations. I have read through the forums, downloaded the latest translation files (sk_SK.po and .mo) and put them here:

    /web/wp-content/languages/plugins
    /web/wp-content/languages
    /web/wp-content/languages/buddypress
    /web/wp-content/languages/plugins
    /web/wp-content/languages/plugins/buddypress

    – obviously I don’t need all of them, but I’m out of my depth here – trying all folders, and no change. WP admin is set to Slovak language. no WP_lang setting, but Buddypress still appears in english?

    the website is vzin.sk, using WPMLS theme from Themeforest.

    Can you tell me what I’m doing wrong please?

    thanks,
    Lukas

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

  • lukascech
    Participant

    @lukascech

    btw, I also tried Loco Translate, created a whole new file, no luck either.


    danbp
    Moderator

    @danbp

    Hi,

    the correct language path is /web/wp-content/languages/plugins/buddypress-sk_SK.mo

    This path is used by any new translation which is completed if you haven’t disabled automatic updates.

    Actually, the slovakian BP file is uncomplete. Question is: is it BuddyPress who isn’t translated (partially or completely) or also your theme ?

    Avaible SK language files can be downloaded here:
    https://translate.wordpress.org/locale/sk/default/wp-plugins/buddypress

    In any case, for SK, you need to complete the work. Best way is to use poEdit and to ensure that the po file has a correct header. Once complete, you can convert it to mo format.

    You need also to remove any po/mo files related to BP who aren’t in the folder i indicated.

    You can find a lot of similar topics to yours (except language itself) on this forum with more details. I don’t want to repeat myself for the xxxth time. 😉


    Henry Wright
    Moderator

    @henrywright

    The Slovak language pack for BuddyPress is currently at 75%. If you have time you could help translate the remaining 25% and avoid the need for a custom .mo file.

    https://translate.wordpress.org/locale/sk/default/wp-plugins/buddypress


    lukascech
    Participant

    @lukascech

    Hi Danbp, thanks for responding.

    I have the file there: /web/wp-content/languages/plugins/buddypress-sk_SK.mo and also buddypress-sk_SK.po

    77% translation is ok for my use case. I have checked the .po file and found the strings I see in english translated to slovak there. For example here: http://vzin.sk/register/ I have checked the “Registerint is easy” string or Account Details and it’s translated in the .po file.

    Not sure how is (Required) in Profile Details translated to (Pozadovane), but others are not?

    Is there any setting aside from just placing the file in a folder?

    thanks,
    Lukas


    lukascech
    Participant

    @lukascech

    I have the .po and .mo files from https://translate.wordpress.org/locale/sk/default/wp-plugins/buddypress (the stable – latest release version).

    Henry – fair point, will do some of it 🙂


    danbp
    Moderator

    @danbp

    Threre is no spcial setting.

    If you want to start a custom mo, you have to compare the content of the pot (with a t) file coming with each major version and the curent .po file – this is the only way to ensure alt strings are identic.

    Great that you’re willing to translate. If so, i suggest that you ask to became the SK editor, so you could manage your work but also other, and specially you can approve or reject strings translated by other slovakian people.

    SK has no editor at the moment and a lot of strings are currently waiting for approval. Don’t be shy ! Post a request here.


    lukascech
    Participant

    @lukascech

    I don’t want to start a custom mo, I just want to translate some strings and ensure the plugin reads the translation. Wasn’t expecting such complications.

    How about Loco Translate? Seems it has no effect on the plugin either, even if it’s setup correctly – using the actual buddypress .pot file, but translating the strings has no effect, no matter where I save the file.

    Especially strange is that the strings are translated in my .po file, they are the same as in the .pot file, still – no effect?

    Editor request submitted.


    r-a-y
    Moderator

    @r-a-y

    If you have a custom language file, it belongs in /wp-content/languages/buddypress/.

    See:

    Languages and Translations


    lukascech
    Participant

    @lukascech

    Hi Ray,

    I have it there too, no effect, see all the linnks above. I have read the translation manual and checked that all requirements are met, but buddypress simply ignores any files I put in any of the folders mentioned here on the forums.

    Happy to provide FTP access or admin login over email if someone can help – seems that Buddypress translation has a bug.

    thanks,
    Lukas


    r-a-y
    Moderator

    @r-a-y

    It looks like you are right, Lukas.

    imath wrote about this issue with bbPress, but the same probably applies to BuddyPress:
    https://imathi.eu/2016/09/20/wordpress-4-6-un-grain-de-sel-dans-le-poivrier/ (It’s in French, but use Google Translate)

    This is a variation of imath’s code to work with BuddyPress:

    function fix_bp_custom_language_packs( $bp = null ) {
    	// No need to perform this action, it's too late!
    	remove_action( 'bp_load_textdomain', array( $bp, 'load_textdomain' ), 5 );
    	/**
    	 * To be sure the custom language pack is loaded, let's be the first to load the textdomain
    	 * 
    	 * NB: bp_loaded is hooking 'plugins_loaded' at 10. Hooking 'plugins_loaded' later than 10
    	 * won't load the custom language pack
    	 */ 
    	add_action( 'bp_loaded', array( $bp, 'load_textdomain' ), 0 );
    }
    add_action( 'bp_after_setup_actions', 'fix_bp_custom_language_packs', 10, 1 );

    Put the code in wp-content/plugins/bp-custom.php.

    I haven’t tested this, but imath is usually correct!

    Let us know if the code works for you, Lukas.


    lukascech
    Participant

    @lukascech

    Hi Ray,

    thanks for the input and adjusting the code for me. Tried the code in bp-custom.php, also in functions.php of my child theme or the parend theme – no change.

    I checked all possible ways of translating those strings (searched for them in all theme translation files, but they are not there, only in BuddyPress files).

    BUT – then I got reaaaaallly righteously angry :). I thought about who is more likely to create a shortcut and cut corners – BuddyPress team, or a Theme creator that uses BuddyPress?

    guess what. The theme creators hard-coded the registration page fields into their register.php (VPLMS theme).

    Will write to them and reference this thread.

    Thanks for your time and support!
    Lukas


    pandraka
    Participant

    @pandraka

    I’m having the same issue with the twentytwelve theme. I’ve followed all the steps you’ve outlined. Is there anything else I can try?


    Sweeny
    Participant

    @sweeny

    Hi!

    I have the same issue with another (Premium) theme. My custom Buddypress language files weren’t used… and your (@r-a-y) code doesn’t work for me.

    Kind regards
    Alex


    lukascech
    Participant

    @lukascech

    One thing I’d also suggest is hitting the sync button on the translation file in Loco Translate and it might pick up new strings which you’ll then be able to translate.

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Skip to toolbar