Skip to content

Bug: Translation key separated by dot #2932

Description

@MichalPB1

Describe the bug
In version 4.0.2 translation keys may be separated by a dot. E.g

return [
     'quantity' => 'Quantity',
     'logs.quantity' => 'The quantity of the product has been changed to <b>{value}</b>',
];

However, in version 4.0.3 it no longer works as before. The logs.quantity key is not found, but strangely, the value from the quantity key is returned. If the quantity key is deleted, we get nothing.

After changing the split into nested arrays, everything works as it should

return [
    'quantity' => 'Quantity',
    'logs' => [
        'quantity' => 'The quantity of the product has been changed to <b>{value}</b>',
    ],
];

CodeIgniter 4 version
4.0.3

Affected module(s)
Language

Probably after changes in this pull request #2833

Expected behavior, and steps to reproduce if appropriate

If we don't use nested arrays in translations

lang ('Product.quantity') should return Quantity

lang ('Product.logs.quantity') should return The quantity of the product has been changed to <b>{value}</b>

Context

  • OS: Ubuntu
  • Web server cli-server
  • PHP version 7.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions