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

Translation Strings as Keys support and adding file name in key option #49

Merged
merged 6 commits into from
Jan 19, 2024

Conversation

benaja
Copy link
Contributor

@benaja benaja commented Jan 15, 2024

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.

@MohmmedAshraf
Copy link
Owner

Hey @benaja,

Appreciate your PR! I'll check it out in a few days. Planning to release a new version with some breaking changes as I've moved from Livewire to Inertia and some new features has been added as well.

After the release, let's tackle this together if that works for you.

Best,
Mohamed

@MohmmedAshraf MohmmedAshraf merged commit 77bb15f into MohmmedAshraf:main Jan 19, 2024
5 checks passed
@MohmmedAshraf
Copy link
Owner

Thanks @benaja

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants