laminas / laminas-i18n

Provide translations for your application, and filter and validate internationalized values
https://docs.laminas.dev/laminas-i18n/
BSD 3-Clause "New" or "Revised" License
50 stars 29 forks source link

[RFC]: Deprecate & Remove Ini format translation files #126

Open gsteel opened 4 months ago

gsteel commented 4 months ago

RFC

Q A
Proposed Version(s) 3.0.0
BC Break? Yes

Description

laminas-config is no longer maintained but the ini file loader available here has a hard dependency on it.

I can't imagine that ini files are a popular format for translations, so I suggest deprecation in the 2.x series for removal in 3.0

This is also one of several dependencies that would prohibit upgrading to service-manager v4

froschdesign commented 4 months ago

laminas-config is no longer maintained but the ini file loader available here has a hard dependency on it.

laminas-config is not needed because a simple return parse_ini_file($resource, true); is enough.

gsteel commented 4 months ago

laminas-config is not needed because a simple return parse_ini_file($resource, true); is enough.

Unfortunately, it's not enough - i18n expects a nested array where dot is used to delimit the next level:

[translation]
identifier1.message  = "Message 1"

parse_ini_file won't turn that into

[
  'translation' => [
    'identifier1' => [
      'message' => 'Message 1',
    ],
  ],
]

If ini format must be kept, we'll need to copy over a lump of code from the parser in laminas-config