WordPress.org

Make WordPress Core

Changes between Version 3 and Version 6 of Ticket #42725


Ignore:
Timestamp:
11/29/2017 12:06:58 PM (3 years ago)
Author:
yoavf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #42725 – Description

    v3 v6  
    2020- Major props to @glueckpress for being a driving force in creating this with his [https://wordpress.tv/2017/06/27/caspar-hubinger-big-little-shame-a-tale-of-empowered-user-experience-through-localisation/ WC Europe 2017 talk].
    2121
     22----
     23
     24'''How _g() works:'''
     251. When makepot/extract sees a `_g()` call, it just adds a `_wpg_` context to the string.
     262. GlotPress, via the gp-gender plugin linked above, will store up to 3 translations (unknown/female/male) for a string with the context `_wpg_`.
     273. On export from GP, the output will contain three distinct entries, with either `_wgp_`, `_wpg_male_` or `_wpg_female_` as the context.
     284. When rendering `_g()`, it will use the `_wpg_` context if the gender is unknown, otherwise, it will use either `_wpg_male_` or `_wpg_female_`.
     29
     30The only part I consider missing here, is that if there's no entry for `_wpg_male_` or `_wpg_female_`, `_g()` should fall back on the default entry.