Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language view: support for i18n string as arrays (those using translateCount #6930

Open
arnaudjuracek opened this issue Jan 22, 2025 · 0 comments · May be fixed by #6935
Open

Language view: support for i18n string as arrays (those using translateCount #6930

arnaudjuracek opened this issue Jan 22, 2025 · 0 comments · May be fixed by #6935
Assignees

Comments

@arnaudjuracek
Copy link

arnaudjuracek commented Jan 22, 2025

Description

Using I18n::translateCount() or its alias tc() requires the use of arrays in language variables:

'translations' => [
    'en' => [
        'errors'  => ['There are no errors', 'There is { count } error.', 'There are { count } errors.'],
    ],
    // …
],

The panel languages view correctly renders the array:

Image

…but does not allow edition of the entries:

Kirby\Cms\LanguageVariable::value(): Return value must be of type ?string, array returned

Your setup

Kirby 4.5.0

@distantnative distantnative changed the title Panel languages view does not allow editing array as language variables used with i18n::translateCount Language view: support for i18n string as arrays (those using translateCount Jan 22, 2025
@afbora afbora self-assigned this Jan 22, 2025
@afbora afbora linked a pull request Jan 23, 2025 that will close this issue
5 tasks
@afbora afbora linked a pull request Jan 23, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants