Jayaprakash 15c9a67028
feat: implement outline block component depth control (#4642)
* feat: add support to control the depth of outline block component

* feat: update localization keys

* feat: add depth option to `BlockOptionButton`

* feat: retrive outline block heading components upto the depth level

* feat: add depth option config to editor configuration

* test: outline block depth control

* feat: add outline block placeholder

* refactor: remove redundant codes

* ci: trigger github actions

* chore: refactor `OptionDepthType` enum

* fix: flutter ci error

* refactor: removed `finalHeadingLevel` from outline keys

* fix: flutter ci error
2024-02-20 10:52:06 +08:00

81 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
String languageFromLocale(Locale locale) {
switch (locale.languageCode) {
// Most often used languages
case "en":
return "English";
case "zh":
switch (locale.countryCode) {
case "CN":
return "简体中文";
case "TW":
return "繁體中文";
default:
return locale.languageCode;
}
// Then in alphabetical order
case "am":
return "አማርኛ";
case "ar":
return "العربية";
case "ca":
return "Català";
case "ckb":
switch (locale.countryCode) {
case "KU":
return "کوردی";
default:
return locale.languageCode;
}
case "de":
return "Deutsch";
case "es":
return "Español";
case "eu":
return "Euskera";
case "fr":
switch (locale.countryCode) {
case "CA":
return "Français (CA)";
case "FR":
return "Français (FR)";
default:
return locale.languageCode;
}
case "hu":
return "Magyar";
case "id":
return "Bahasa Indonesia";
case "it":
return "Italiano";
case "ja":
return "日本語";
case "ko":
return "한국어";
case "pl":
return "Polski";
case "pt":
return "Português";
case "ru":
return "русский";
case "sv":
return "Svenska";
case "th":
return "ไทย";
case "tr":
return "Türkçe";
case "fa":
return "فارسی";
case "uk":
return "українська";
case "ur":
return "اردو";
case "hin":
return "हिन्दी";
}
// If not found then the language code will be displayed
return locale.languageCode;
}