Three small i18n findings from translating FluentCart 1.6.5 into German
Thank you so much for FluentCart 1.6.5. The date and timezone work has landed
in the release, the separator filter is there exactly as discussed, and the new
email confirmation flow is a real gift for stores that sell to guests. It is a
pleasure to translate a plugin that moves this fast. Three small things came up
while we were translating 1.6.5 into German, kept together here so they are
easy to read in one go.
7. A licence notice assembled from fragments, with a hardcoded date
app/Services/PluginManager/FluentLicensing.php:237 builds the expiry notice
by concatenating two translatable fragments with untranslatable English text:
'<p>Your ' . $plugin_title . ' ' . __('license has been', β¦)
. ' <b>' . __('expired at', β¦) . ' ' . gmdate('d M Y', β¦) . '</b>, Please '
Two things follow from that:
YourandPleaseare outside the catalogue, so the sentence stays half
English in every language. German word order also cannot be reached from
two fragments pinned in place, so the best a translator can do is a hybrid.- The date uses
gmdate('d M Y', β¦), so it is both a hardcoded pattern and
rendered in GMT rather than the store timezone. East of UTC an evening
expiry shows the previous day.
One __() call with placeholders would fix both, for example:
__('Your %1$s license expired at %2$s.', 'fluent-cart-pro')
with the date formatted the way the rest of 1.6.4 does it.
8. on %s carries two meanings and has no msgctxt
The same msgid is used for two different things:
app/Helpers/Helper.phplines 1383 and 1406: the schedule anchor, "on
Friday", "on Aug 19"app/Models/Order.phpline 643: the tax base, "19 % on 69,00"
German needs a different word for each, am Freitag but auf 69,00, so one
translation is always wrong in one of the two places. _x() with a context
would solve it without touching the English text, the same fix as for Apply
and More.
9. Two spellings of "colour" in the new 1.6.5 colour settings
A small one, noticed while translating the storefront colour module in 1.6.5.
app/Services/Theme/ThemePalette.php uses British spelling in two strings,
line 816 and the plural entry at line 823:
The active theme does not publish a colour palette, β¦
%1$s provides %2$d palette colour. / β¦ palette colours.
The other 51 strings of the same feature use American spelling, including
ColorPalette.php and api/StoreSettings.php, which render on the same
screen. Nothing breaks, and translations are unaffected, but the English UI
shows both spellings side by side.