-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Callback method when the translation for the key is not found. #469
base: develop
Are you sure you want to change the base?
Conversation
LGTM, could you write test code for |
@kyle-seongwoo-jun sure. I will write as soon as I am available. |
66adb74
to
8048ff5
Compare
omg, I need this! |
@kyle-seongwoo-jun I have added a test, could you review it? |
use debugprint instead of print to fix linting
@@ -18,6 +18,9 @@ void main() async { | |||
Locale('ru', 'RU') | |||
], | |||
path: 'resources/langs', | |||
onLocaleKeyNotFound: (key, locale) { | |||
print('Locale key not found $key ${locale.languageCode}'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use EasyLocalization.logger instead of print
this.assetLoader = const RootBundleAssetLoader(), | ||
this.saveLocale = true, | ||
this.errorWidget, | ||
this.onLocaleKeyNotFound}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing comma is missing
})); | ||
}); | ||
|
||
test('should call onLocaleKeyNotFound', () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add another test to verify that the method is NOT called when the translation exists
@stha-ums Sorry that you waited so long here. Are you still willing to contribute this feature? (I submitted a review). |
@bw-flagship , thank you for taking the time to review, I will address these as soon as possible. |
This makes us able to perform extra tasks if there is no translation available.
For example, The project I am working on uses localization from the backend. And need to tell the backend if any translation is missing. So this method allows me to achieve that.