Translation Strings as Keys support and adding file name in key option #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enhanced Support for Translation Strings as Keys
Previously, the ability to translate files using the "Using Translation Strings as Keys" method was unavailable. These files are typically stored like "lang/en.json," as opposed to the "lang/en/*" directory. I have now implemented functionality to enable the translation of these files as well.
Integration of File Name in Translation Keys
In Laravel, short keys are usually accessed via __("filename.key"). However, this package previously disregarded the filename in the key, leading to inconsistencies. For example, if there's a translation key in a Laravel application like "validation.attributes.name," it should be possible to locate this exact string using the Translation UI search bar. To address this, I have introduced a config option that allows for the inclusion of the filename in the translation key, enhancing searchability and consistency in key naming.
Exclude files pattern
It is now also possible to use pattern matching for the exclude_files option. For example you can use "*.php" to exclude all php files and then only be able to translate all json files.