mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-08-09 09:22:31 +00:00

* fix: rename fr.json to fr-FR.json * fix: the translation mistakes in fr-FR.json * fix: added french language to system Co-authored-by: MikeWallaceDev <mike@wallacehub.com>
35 lines
775 B
Dart
35 lines
775 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
String languageFromLocale(Locale locale) {
|
|
switch (locale.languageCode) {
|
|
// Most often used languages
|
|
case "en":
|
|
return "English";
|
|
case "zh":
|
|
return "简体中文";
|
|
|
|
// Then in alphabetical order
|
|
case "de":
|
|
return "Deutsch";
|
|
case "es":
|
|
return "Español";
|
|
case "fr":
|
|
switch (locale.countryCode) {
|
|
case "CA" :
|
|
return "Français (CA)";
|
|
case "FR" :
|
|
return "Français (FR)";
|
|
default :
|
|
return locale.languageCode;
|
|
}
|
|
case "it":
|
|
return "Italiano";
|
|
case "ru":
|
|
return "русский";
|
|
|
|
// If not found then the language code will be displayed
|
|
default:
|
|
return locale.languageCode;
|
|
}
|
|
}
|