• Resolved moacirsantana

    (@moacirsantana)


    Hello! The plugin has been working perfectly.

    Only one detail related to languages:

    I have the wordpress default language but every user has its locale, some are in Portuguese, some in English, some Spanish, etc.

    The translation only seems to work depending on the WordPress Default Language and not on the user’s.

    The default language is English, and it keeps showing the texts in English for those whose locale are Spanish.

    How to show the strings according to the current user locale?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Javier Carazo

    (@carazo)

    @moacirsantana,

    Sorry I do not understand your question.

    With this plugin, what you can do, is to save the “locale” of every user.

    This is a meta called “locale” that should contain a string like this: es_ES (Spanish of Spain, change this value for the one you need in every user).

    Thread Starter moacirsantana

    (@moacirsantana)

    I know, I’m talking about the shortcode to be used on the frontend

    The language on the frontend is always English, even if the user has its locale set as Spanish/Portuguese.

    How to change the language on the frontendfor those users based on their locale?

    Plugin Author Javier Carazo

    (@carazo)

    OK. Please next time try to be more precise. I never thougth you were talking about frontend.

    Respect what you are talking, this is not a problem from the plugin, as you can see in the plugin:

    <form method="POST" enctype="multipart/form-data" action="" accept-charset="utf-8" class="acui_frontend_form">
    			<label><?php _e( 'CSV file <span class="description">(required)</span>', 'import-users-from-csv-with-meta' ); ?></label></th>
    			<input class="acui_frontend_file" type="file" name="uploadfile" id="uploadfile" size="35" class="uploadfile" />
    			<input class="acui_frontend_submit" type="submit" value="<?php _e( 'Upload and process', 'import-users-from-csv-with-meta' ); ?>"/>
    
    			<?php wp_nonce_field( 'codection-security', 'security' ); ?>
    		</form>

    All translatable is translated but the input type file, will be rendered in the language of the browser.

    Thread Starter moacirsantana

    (@moacirsantana)

    Right, I noticed that everything is translated on the frontend based on the WordPress default language, but I need to translate according to the user’s locale.

    You can test it and you will see what I mean. Set your WordPress default language to Spanish, and then create a user with English locale.

    Once you log in with this user, the strings will be in Spanish because of the default language, not English (user locale)

    That’s what I need, based on the user’s locale.

    Plugin Author Javier Carazo

    (@carazo)

    Sorry this is not a problem from this plugin.

    This plugin use the standard i18n and WordPress works in this way: the user’s profile local will only affect the backed; in the frontend, it will always be used the WordPress language.

    You can check it for example in the admin bar.

    You can create a ticket to WordPress core team if you think it should be changed or you can use some multilanguage plugin to achieve it.

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

The topic ‘Language issue’ is closed to new replies.