feat: Find lang() strings and update localization keys |
@kenjis see pls fork https://github.com/neznaika0/codeigniter...age-finder
* The command lang :find searches for translation (lines lang('File.key')) files in the default APPPATH folder and ignoring APPPATH . Language/ path. * The command is able to recognize nested keys normally (File.form.placeholder.text). After the update, the developer only needs to add the necessary translation, and not search through the entire lang() code * Bad lines are skipped. * Added some tests. After checking, the created files are cleared. I need a response for a reliable PR. Known issues: ! Each update overwrites comments in the language file
! php-cs-fixer may not work for appstarter project (if require-dev disabled)
! I would like to add translations where they possibly should be, for example, Config/Validation ! It would be nice to add hints (boolean) if the translation contains variables. For example, File.form.placeholder.text {vars} will indicate the presence of some dependencies in the phrase
1. Update all in APPPATH and default locale: Code: $ php spark lang:find 2. Find and update translations in a specific folder (+ subfolders) and select a new locale: Code: $ php spark lang:find --dir Controllers/Translation --locale ru 3. Find translations and show table with new translations: Code: $ php spark lang:find --dir Controllers/Translation --show-new 4. Detailed output. Can be added to other options: Code: $ php spark lang:find --verbose --dir Controllers/Translation --show-new Code: aleksandr@aleksandr-debian:~/www/ci-demo$ php spark lang:find --dir Controllers/Translation --verbose --show-new PHP Code: // Language/{locale}/TranslationThree.php
Simple CI 4 project for beginners codeigniter-expenses
|
Messages In This Thread |
feat: Find lang() strings and update localization keys - by ozornick - 08-20-2023, 10:13 PM
RE: feat: Find lang() strings and update localization keys - by ozornick - 08-21-2023, 12:39 AM
RE: feat: Find lang() strings and update localization keys - by kenjis - 08-21-2023, 06:26 PM
RE: feat: Find lang() strings and update localization keys - by ozornick - 08-21-2023, 08:22 PM
RE: feat: Find lang() strings and update localization keys - by ozornick - 08-21-2023, 10:59 PM
RE: feat: Find lang() strings and update localization keys - by kenjis - 08-22-2023, 06:05 PM
RE: feat: Find lang() strings and update localization keys - by ozornick - 08-31-2023, 06:30 AM
RE: feat: Find lang() strings and update localization keys - by kenjis - 09-09-2023, 07:20 PM
|