best_naveen_localization 0.0.2 copy "best_naveen_localization: ^0.0.2" to clipboard
best_naveen_localization: ^0.0.2 copied to clipboard

A cool localization package for every developer.

example/lib/main.dart

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);
}
40
likes
0
pub points
18%
popularity

Publisher

unverified uploader

A cool localization package for every developer.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on best_naveen_localization