Rafasashi

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • in reply to: Default Locale #8856
    Rafasashi
    Keymaster

    Following up on our recent WhatsApp conversation:

    The plugin utilizes the get_option('WPLANG') function to establish the default language.

    To modify this setting, please navigate to ../wp-admin/options.php and adjust the WPLANG value to en_US.

    in reply to: Languages Everywhere plugin compatibility #8851
    Rafasashi
    Keymaster

    Following up on our recent WhatsApp conversation:

    We identified that the issue came from a plugin generating pages without setting the global $post variable.

    This omission prevents the Language Switcher from retrieving the post ID.

    For others encountering this problem, a workaround involves passing the post ID to the Language Switcher via a custom script, as demonstrated below:

    add_action('lsw_get_current_post_id',function($post_id){
    	
            // fetch the custom post id here
    	return $post_id;
    	
    },999999,1);
    in reply to: Canadian French missing from languages #8715
    Rafasashi
    Keymaster

    Thank you for reporting this.

    The version 3.7.4 now includes Canadian French.

    • This reply was modified 1 year, 4 months ago by Rafasashi.
    in reply to: How to set up in network #8714
    Rafasashi
    Keymaster

    Hello there,

    It seems that you should treat each network as independent since they all have a translated page/version in the same installation.

    At the end it doesn’t really matter since you have to manually set the url of the translated pages on both sides ( in your case German and English )

    Check this out:

    Step by step implementation of Language Switcher in a single wordpress website

    in reply to: Issue with returning to default language page #8614
    Rafasashi
    Keymaster
    To summarize the solution from our previous email conversation.
    Right now the Croatian link takes the current url as default value when the page language is unknown because Croatian is the default language of the site.
    The next step is to set up the urls for each post/page.
    When you edit the post you should see in the sidebar of the editor the following language box :
    Additionally here is a Step by step implementation of Language Switcher in a single wordpress website:
    • This reply was modified 1 year, 5 months ago by Rafasashi.
    • This reply was modified 1 year, 5 months ago by Rafasashi.
    in reply to: Parameter for wp_insert_post #8593
    Rafasashi
    Keymaster

    Sorry for the delay.

    First you need to build an array for the switcher:

    $switcher = array(
    	
    	'urls' => array(
    
    		'fr' => false,
    		'en' => 'https://',
    	),
    	'main' => 'fr',
    );

    Then update the 2 following post meta data:

    update_post_meta( $post_id, 'lsw_language_switcher', $switcher);
    
    update_post_meta( $post_id, 'lsw_main_language', $switcher['main']);

    If you are editing a post that already has settings don’t forget to merge the previous array with the new one:

    $switcher= get_post_meta( $post_id, 'lsw_language_switcher', true);
    
    // add/modify english url
    
    $switcher[urls]['en'] = 'https://';
    
    update_post_meta( $post_id, 'lsw_language_switcher', $switcher);
    in reply to: Get language of current page in functions.php #8582
    Rafasashi
    Keymaster

    Technically yes.

    Assuming you have a $post_id you can do:

    $lang = Language_Switcher::instance()->get_post_language($post_id);

    For a term it is:

    $lang = Language_Switcher::instance()->get_term_language($term_id);

    Either way you should get something like:

    array(2) {
      ["urls"]=>
      array(1) {
        ["en"]=>
        bool(false)
      }
      ["main"]=>
      string(2) "en"
    }

    To retrieve the language use:

    $lang['main']
    in reply to: Missing flag for Austria – (Österreich) #8561
    Rafasashi
    Keymaster

    Hello,

    Thank you for pointing this out!

    3.7.2 should fix that when activating Austrian German / Österreichisches Deutsch

    The flag should follow.

    Let me know if it works for you.

    in reply to: Mistake with USA flag #8294
    Rafasashi
    Keymaster

    Just passing the solution you emailed me earlier for the users in the same situation:

    .flag.flag-en {
    
    	background-position: -256px -143px;
    }

    Thanks!

    in reply to: When switching languages some of the Menu Items disappear #8287
    Rafasashi
    Keymaster

    I am not excluding the fact that it could be a bug but first let see if the regular behavior of the plugin is applied.

    When you switch to a language the menu should show only the items from the same language.

    Is the translation url set for the “disappearing items”?

    Alternatively your can try to disable this filter by checking the “Disable Menus Query Filter” box in admin panel > Languages > Settings

    Let me know if it works for you.

    in reply to: Mistake with English flag #8166
    Rafasashi
    Keymaster

    The plugin follows the core WP language location/pair and point to the national flag.

    In some cases (such as UK or US) it might not reflect the identity of the site and this is why I made the flag implementation optional by manually adding it to the CSS.

    My suggestion to solve this issue is to tweak the CSS either by modifying the image containing all the flags located or by pointing the CSS rule to another flag.

    To use a custom image follow these steps:

    1 – Download the flag image located in the plugin at:

    language-switcher\assets\images\flags.png

    2 – Modify the flag with an image editor

    3 – Upload the new flags in your media gallery

    4 – Replace manually the url of the old flags by the new flags in the CSS rule

    This change will not be affected by future plugin upgrades.

    • This reply was modified 2 years, 2 months ago by Rafasashi.
    • This reply was modified 2 years, 2 months ago by Rafasashi.
    • This reply was modified 2 years, 2 months ago by Rafasashi.
    in reply to: Mistake with Czech flag #8156
    Rafasashi
    Keymaster

    Hello,

    Thank you for reporting this.

    The CSS for the Czech flag is missing in the example.

    We will add it but in the meantime you can manually add this into your style:

    .flag.flag-cs{
    	background-position:-16px -33px
    }
    • This reply was modified 2 years, 3 months ago by Rafasashi.
    • This reply was modified 2 years, 3 months ago by Rafasashi.
    in reply to: Use Flags like in the widget anywhere? #8128
    Rafasashi
    Keymaster

    Hello there!

    The language selections should be prefixed by <span class="flag flag-{iso}"></span> allowing you to implement flags via CSS:

    How to show a country flag in front of the language selection?

    Is it answering you question?

    • This reply was modified 2 years, 5 months ago by Rafasashi.
    • This reply was modified 2 years, 5 months ago by Rafasashi.
    • This reply was modified 2 years, 5 months ago by Rafasashi.
    in reply to: Cannot set Language permalinks #8101
    Rafasashi
    Keymaster

    Hello Martin,

    Thank you for reporting this.

    The issue was fixed in the version 3.5.0

    Could you please try and let me know if it works for you?

    Rafasashi
    Keymaster

    You are welcome!

    Thank you for your kind words.

    Unfortunately the plugin do not yet offer the option to differentiate the language of the individual links in the menu.

    I think that the best option would be to use one WP installation per language to be able to customize the respective menus accordingly.

Viewing 15 posts - 1 through 15 (of 17 total)