Closed andjsch closed 1 week ago
I'd do something like this:
resources/lang/en/dictionary-countries.php
<?php
return [
'regions' => [
'africa' => 'Africa',
'americas' => 'Americas',
'asia' => 'Asia',
'europe' => 'Europe',
'oceania' => 'Oceania',
'polar' => 'Polar',
],
'subregions' => [
'southern_asia' => 'Southern Asia',
// etc
],
'names' => [
'AFG' => 'Afghanistan',
// etc
],
];
protected function getItems(): array
{
return [
[
'name' => __('statamic::dictionary-countries.names.AFG'),
'iso3' => 'AFG',
'iso2' => 'AF',
'region' => __('statamic::dictionary-countries.regions.asia'),
'subregion' => __('statamic::dictionary-countries.subregions.southern_asia'),
'emoji' => '🇦🇫'
],
// etc
];
Bug description
Currently, if you view the CP in another language and use one of the predefined dictionaries, the labels are not translated. I think translating Countries and Currencies would be sufficient enough.
If this is something that would be considered for a merge, I'd be happy to provide a PR.
For the PR, it should be considered where to put the translations.
{lang}.json
file, which would be convenient, but messydictionaries.php
file where the translated dictionaries are within an arraycountries.{iso2}
currencies.{code}
How to reproduce
Create a dictionary fieldtype within come blueprint and change the language to anything !English.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response