Translation issueshttps://lab.civicrm.org/dev/translation/-/issues2024-03-29T02:04:10Zhttps://lab.civicrm.org/dev/translation/-/issues/84`testLocalizedData()` failing after recent strings update2024-03-29T02:04:10Ztotten`testLocalizedData()` failing after recent strings updateIn CI, the test `testLocalizedData()` has started failing consistently. I've done some hunting and may have an explanation (*but don't know the next step*).
__The Test__: `testLocalizedData()` generates the SQL data-set in two locales. ...In CI, the test `testLocalizedData()` has started failing consistently. I've done some hunting and may have an explanation (*but don't know the next step*).
__The Test__: `testLocalizedData()` generates the SQL data-set in two locales. It spot-checks the data for a common string that should usually be translated. Specifically, `New Organization` is a link in the default menu. It's translated as `Neue Organisation` (`de_DE`) or `Nouvelle organisation` (`fr_FR`).
__Compare__: The test passes on my laptop but not in CI. My laptop has older translation data than the server.
You can manually inspect by running a small script and grepping the output (`cv scr printsql.php | grep Neue`):
```php
function _getSqlLive($locale) {
$schema = new \CRM_Core_CodeGen_Schema(\Civi\Test::codeGen());
$files = $schema->generateLocaleDataSql($locale);
foreach ($files as $file => $content) {
if (preg_match(';^civicrm_data\.;', $file)) {
return $content;
}
}
throw new \Exception("Failed to generate $locale");
}
echo _getSqlLive('de_DE');
```
Both outputs include some translated strings, but the newer doesn't have as many:
```diff
---Local machine, old data
+++Server machine, new data
("Individual,Contact",NULL,"4","0","1","new_individual","Neue Person"),
-("Organization,Contact",NULL,"5","0","1","new_organization","Neue Organisation"),
-("Household,Contact",NULL,"6","0","1","new_household","Neuer Haushalt"),
+("Organization,Contact",NULL,"5","0","1","new_organization","New Organization"),
+("Household,Contact",NULL,"6","0","1","new_household","New Household"),
```
If I inspect the data (`msgunfmt civicrm.mo -o civicrm.po`), I find these in the old data-set:
```
msgid "New Individual"
msgstr "Neue Person"
msgid "New Organization"
msgstr "Neue Organisation"
msgctxt "menu"
msgid "New Individual"
msgstr "Neue Person"
msgctxt "menu"
msgid "New Organization"
msgstr "Neue Organisation"
```
And these in the new data-set:
```
msgid "New Individual"
msgstr "Neue Person"
msgctxt "menu"
msgid "New Individual"
msgstr "Neue Person"
msgctxt "menu"
msgid "New Organization"
msgstr "Neue Organisation"
```
So it's missing `New Organization` in the default context. Additionally, the phrases `Phone Call` and `Meeting` appear in the old data-set but not the new data-set. I see similar omissions in `fr_FR`.
I assume that the SQL translation is evaluating everything in the default context. (It doesn't seem to use the `menu` translations). I don't know if that's good or bad. But regardless, it's probably bad that `Phone Call` and `Meeting` are missing.
In the CI logs for `testTranslatedData()`, the failure starts on roughly Feb 4. (Some places seem to start Feb 5 -- l10n data is cached for a bit.) I'm guessing this is related the new strings released around Feb 4 (https://chat.civicrm.org/civicrm/pl/jyqia56a47dp5dnrouiabnmnuw).
(ping @bgm)https://lab.civicrm.org/dev/translation/-/issues/85Some strings in core afforms do not translate2024-03-25T18:55:32ZbgmSome strings in core afforms do not translateFor example:
- Enable CiviCampaign
- Go to the CiviCampaign dashboard
![image](/uploads/49a1d30b027b36f57971cbc4fb9d48ff/image.png)
For the tabs, the strings are correctly wrapped with `ts`, and I double-checked that the strings are t...For example:
- Enable CiviCampaign
- Go to the CiviCampaign dashboard
![image](/uploads/49a1d30b027b36f57971cbc4fb9d48ff/image.png)
For the tabs, the strings are correctly wrapped with `ts`, and I double-checked that the strings are translated in my translation file.
For the placeholders on the filter fields, the strings are not correctly wrapped in `ts`, but even if I do wrap them, and I make sure to add the strings to my translation files, they do not translate.
cc @colemanw