Skip to main content

Three small i18n findings from translating FluentCart into German

Three i18n findings from translating FluentCart into German, all measured
against 1.7.0 and unchanged since 1.6.4. They are code-level rather than
release-specific, which is why they sit in their own post.

Related: the msgctxt added to the state names in 1.6.6 solved exactly this
class of problem for the geo data. Point 8 is the same case, still open.

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:

  • Your and Please are 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 DateFormatter does it everywhere else.

8. on %s carries two meanings and has no msgctxt

The same msgid is used for two different things:

  • app/Helpers/Helper.php lines 1430 and 1455: the schedule anchor, "on
    Friday", "on Aug 19"
  • app/Models/Order.php line 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 storefront colour module

A small one, noticed while translating the storefront colours.
app/Services/Theme/ThemePalette.php uses British spelling in two strings,
line 1111 and the plural entry at line 1118:

The active theme does not publish a colour palette, …
%1$s provides %2$d palette colour. / … palette colours.

The other 53 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.