best_naveen_localization 0.0.2 best_naveen_localization: ^0.0.2 copied to clipboard
A cool localization package for every developer.
import 'package:best_naveen_localization/best_naveen_localization.dart';
void main() {
// if you want to use commonwords tranlation then directly use
CommonTranslations.back;
CommonTranslations.cancel;
CommonTranslations.confirm;
//or you can create your translation like this
final Map<String, Map<String, String>> translations = {
'en': {
'explore': 'Explore',
'profile': 'Profile',
},
'fi': {
'explore': 'Selaa',
'profile': 'Profiili',
},
'ar': {
'explore': 'استكشاف',
'profile': 'الملف الشخصي',
}
};
String getTranslation(String key) {
final Map<String, String>? languageMap = translations[GetLocale.langcode];
return languageMap != null ? languageMap[key] ?? key : key;
}
String explore = getTranslation('explore');
String profile = getTranslation('profile');
print(explore);
print(profile);
}