Support » Plugin: Import users from CSV with meta » How to import user’s preferred language ?

  • stephanemartinw

    (@stephanemartinw)


    Hi,

    The WP user admin panel allows to set the user’s preferred language.

    Is it possible to import it with your plugin ?

    Thank you in advance for your replay,

    Stephane

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

    (@carazo)

    @stephanemartinw,

    Do you know how user’s preferred language is saved in database? If yes tell me and we see how it can be done.

    stephanemartinw

    (@stephanemartinw)

    I think it’s just another user meta to import (a column to add to csv file), ‘locale’ seems to be the meta_key.
    Correct ?

    Plugin Author Javier Carazo

    (@carazo)

    If this is the meta correct… yes.

    I don’t know how it works. I know how my plugin works: new column, new key and if it is correct for your purpose it will work.

    hi,

    I’m trying to help by doing a test run. I poked around and then saw what happened in the database. Here’s what I found.

    First, “Users” > “Edit User” > “Language” was set to “Site Default”, and in the database dump was this:
    INSERT INTO 'wp_usermeta' VALUES ...,('33','2','locale',''),...;

    Then, “Users” > Edit User -> Language -> (switch to Brazilian Portugese), and in the new database dump showed this:
    INSERT INTO 'wp_usermeta' VALUES ...,('33','2','locale','pt_BR'),...;

    • This reply was modified 5 months ago by  mjassen (mjjojo). Reason: correct backticks escape syntax
    Plugin Author Javier Carazo

    (@carazo)

    @mjjojo,

    Thank you very much!

    So @stephanemartinw the solution is:
    * Column: locale
    * Value: pt_BR

    For example 🙂

    stephanemartinw

    (@stephanemartinw)

    Hello,

    Thank you both for your help!
    I’ve tested and it works.
    Just on thing : on the profile page, at bottom, a :

    Extra profile information
    locale fr_FR

    is added to the page, but is a duplicate info because the preferred language above is correctly filled.
    A way to avoid this ?

    Thanks again.

    Best regards,

    Stephane

    Plugin Author Javier Carazo

    (@carazo)

    Stephane,

    I have to include it as a field that must not be shown.

    In next version it will be included.

    Plugin Author Javier Carazo

    (@carazo)

    Done 🙂

    Great support! Thank you !

    Plugin Author Javier Carazo

    (@carazo)

    Please remind the good review or a little donation please 🙂

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