Gender-based translation

  • Hello,

    I'd like to translate the messages that are sent to the user. There are messages starting with:

    Dear {@$username},


    In this case, in Spanish we need to specify the gender, so I would like to do something like this:

    If user is male:
    Estimado {@$username},

    If user is female:
    Estimada {@$username},

    If not specified:
    Estimado(a) {@$username},

    How can I do it?


    P. S.: I don't know if this is important to mention but I changed the default values of the language variables wcf.user.gender.male and wcf.user.gender.female to display gender as a font awesome icon.

    My styles and plugins in the Plugin-Store.

    Spoiler anzeigen

    — ¡Carajo! —gritó

    Amaranta, que empezaba a meter la ropa en el baúl, creyó que la había picado un alacrán.

    — ¿Dónde está? —preguntó alarmada.

    —¿Qué?

    — ¡El animal!

    Úrsula se puso un dedo en el corazón.

    — Aquí —dijo.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫

  • Hello and thanks,

    I modified the language variable for lost password:


    And I get this error:


    My styles and plugins in the Plugin-Store.

    Spoiler anzeigen

    — ¡Carajo! —gritó

    Amaranta, que empezaba a meter la ropa en el baúl, creyó que la había picado un alacrán.

    — ¿Dónde está? —preguntó alarmada.

    —¿Qué?

    — ¡El animal!

    Úrsula se puso un dedo en el corazón.

    — Aquí —dijo.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫

  • I can't access my website, I wrote {@username} instead of {@$username}. I'm getting a fatal error

    https://soytiburon.co

    My styles and plugins in the Plugin-Store.

    Spoiler anzeigen

    — ¡Carajo! —gritó

    Amaranta, que empezaba a meter la ropa en el baúl, creyó que la había picado un alacrán.

    — ¿Dónde está? —preguntó alarmada.

    —¿Qué?

    — ¡El animal!

    Úrsula se puso un dedo en el corazón.

    — Aquí —dijo.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫

    Einmal editiert, zuletzt von Caribe_Soy (21. April 2016 um 12:44)

    • Offizieller Beitrag

    Use the direct link https://soytiburon.co/acp/


    B2Q:

    Zitat von Alexander Ebert

    sorry for this late reply, I had to lookup a lot of stuff to give you a proper answer, mostly because we were never faced with such a question.

    I've went through the different phrases present in the software and I have come to the conclusion that this is not possible. In some cases phrases are passed a proper user object representing the author, this would allow to provide different endings or terms. The issue arises that the contents of the user objects are anything but consistent, because most of the time it is just a partial object that includes only the user id and username. This is required to save performance by selecting only the data that is usually required, without the overhead of loading all other data.

    You might want to simply try it out, typical variables such as "$user" or "$author" are a user-object and if the data is available, you should be able to handle it like this:

    {if $author->gender == 1}Male{else if $author->gender == 2}Female{else}Unspecified{/if}

    But keep in mind that I cannot guarantee the "gender" field to be always available, so it might require some time to figure our where you can use it. Yet I'm kind of positive that it should be working for both notifications and recent activities because they use some sort of shared cache in the background which always fetches the whole user profile data including the gender.

  • I can't access the ACP

    My styles and plugins in the Plugin-Store.

    Spoiler anzeigen

    — ¡Carajo! —gritó

    Amaranta, que empezaba a meter la ropa en el baúl, creyó que la había picado un alacrán.

    — ¿Dónde está? —preguntó alarmada.

    —¿Qué?

    — ¡El animal!

    Úrsula se puso un dedo en el corazón.

    — Aquí —dijo.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫

  • I just tried in another browser, maybe it was the cache. I fixed it. Thank you very much :love:

    My styles and plugins in the Plugin-Store.

    Spoiler anzeigen

    — ¡Carajo! —gritó

    Amaranta, que empezaba a meter la ropa en el baúl, creyó que la había picado un alacrán.

    — ¿Dónde está? —preguntó alarmada.

    —¿Qué?

    — ¡El animal!

    Úrsula se puso un dedo en el corazón.

    — Aquí —dijo.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!