Skip to content
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

FluentUI Widgets Localization Support #216

Merged
merged 23 commits into from Mar 15, 2022

Conversation

henry2man
Copy link
Contributor

@henry2man henry2man commented Mar 7, 2022

This PR adds support for onboard widgets localization support using intl package.

Related with #213

I've included a wide list of most spoken languages: Arabic, Bengali, English, Spanish, French, Hindi, Indonesian, Portuguese, Russian and Simplified Chinese using Google Translate. UPDATE: ⭐️ @bdlukaa and I (@henry2man) agreed that we prefer confirmed localizations vs "Google Translate" ones, so we need some help!

How to contribute:

Current status:

I've added detailed instructions for adding new localizations in the README.md: https://github.com/bdlukaa/fluent_ui/pull/216/files?short_path=b335630#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5


If you run the example app and change the language of the browser, the corresponding messages are shown.

Also I've done some little tweaks to shortcuts label implementation. AFAIK they aren't strictly that needs a translation (Ctrl or Cmd are standards names for corresponding keys).

Please take notice of changes here: https://github.com/bdlukaa/fluent_ui/pull/216/files#diff-3705042816f3bd9d24304192811bed9d5104fa569a36f063a4166cfea97b845aR376-R377 and here https://github.com/bdlukaa/fluent_ui/pull/216/files#diff-8b7e9df87668ffa6a04b32e1769a33434999e54ae081c52e5d943c541d4c0d25R13-R14 in order to support multilanguage material localizations.

Lastly, take a look at this List<Locale> constant: https://github.com/bdlukaa/fluent_ui/pull/216/files#diff-ccec5c5fa2c4d7bf6bc0e9748a8836c4bc5ff4a8c59461448d14047f6b242617R128-R139

As the note says, this would be defined into DefaultFluentLocalizations but I cannot be able to make it work, so this was a working workarround.

Pre-launch Checklist

  • I have run dartfmt on all changed files
  • I have updated CHANGELOG.md with my changes
  • I have run "optimize/organize imports" on all changed files
  • I have addressed all analyzer warnings as best I could
  • I have added/updated relevant documentation
  • I have run flutter pub publish --dry-run and addressed any warnings

@henry2man henry2man mentioned this pull request Mar 7, 2022
lib/l10n/intl_fr.arb Outdated Show resolved Hide resolved
@WinXaito
Copy link
Collaborator

WinXaito commented Mar 7, 2022

Awesome ! 😄

@henry2man henry2man changed the title [WIP] FluentUI Widgets Localization Support FluentUI Widgets Localization Support Mar 7, 2022
@henry2man
Copy link
Contributor Author

You can consider this PR finished, so it can be merged if you like it.

@bdlukaa
Copy link
Owner

bdlukaa commented Mar 7, 2022

Were these generated by the translator? I don't like the translator idea. For example, the Portuguese translation is totally incorrect

@henry2man
Copy link
Contributor Author

henry2man commented Mar 7, 2022

Were these generated by the translator? I don't like the translator idea. For example, the Portuguese translation is totally incorrect

@bdlukaa English ones are the original ones an I've translated manually the Spanish ones.

In this cases I always prefer a bad translation vs no-translation at all, but this is something that is very easy to fix with this new implementation.

If you prefer it we can confirm two or three new localizations and remove the rest.

@bdlukaa Do you know who can verify the other ones?

@bdlukaa
Copy link
Owner

bdlukaa commented Mar 7, 2022

In this cases I always prefer a bad translation vs no-translation at all, but this is something that is very easy to fix with this new implementation.

It's better a confirmed translation IMO

Do you know who can verify the other ones?

I'll check on my discord server (https://discord.gg/674gpDQUVq)

@henry2man henry2man marked this pull request as draft March 7, 2022 17:28
@henry2man henry2man changed the title FluentUI Widgets Localization Support [WIP] FluentUI Widgets Localization Support Mar 7, 2022
@henry2man
Copy link
Contributor Author

I'll check on my discord server (https://discord.gg/674gpDQUVq)

Sounds great!

@henry2man henry2man changed the title [WIP] FluentUI Widgets Localization Support [WIP] [⭐️Help Needed!] FluentUI Widgets Localization Support Mar 7, 2022
Copy link
Owner

@bdlukaa bdlukaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Translator isn't that bad tho

lib/l10n/intl_pt.arb Outdated Show resolved Hide resolved
lib/l10n/intl_pt.arb Outdated Show resolved Hide resolved
lib/l10n/intl_pt.arb Outdated Show resolved Hide resolved
henry2man and others added 4 commits March 7, 2022 18:43
Co-authored-by: Bruno D'Luka <45696119+bdlukaa@users.noreply.github.com>
Co-authored-by: Bruno D'Luka <45696119+bdlukaa@users.noreply.github.com>
Co-authored-by: Bruno D'Luka <45696119+bdlukaa@users.noreply.github.com>
@raitonoberu
Copy link

lib/l10n/intl_ru.arb

{
  "@@locale": "ru",
  "backButtonTooltip": "Назад",
  "closeButtonLabel": "Закрыть",
  "searchLabel": "Поиск",
  "closeNavigationTooltip": "Закрыть панель навигации",
  "openNavigationTooltip": "Открыть панель навигации",
  "clickToSearch": "Нажмите для поиска",
  "modalBarrierDismissLabel": "Отмена",
  "minimizeWindowTooltip": "Свернуть",
  "restoreWindowTooltip": "Восстановить",
  "closeWindowTooltip": "Закрыть",
  "dialogLabel": "Диалог",
  "cutActionLabel": "Вырезать",
  "copyActionLabel": "Копировать",
  "pasteActionLabel": "Вставить",
  "selectAllActionLabel": "Выбрать все",
  "newTabLabel": "Новая вкладка",
  "closeTabLabelSuffix": "Закрыть вкладку",
  "scrollTabBackwardLabel": "Прокрутить назад",
  "scrollTabForwardLabel": "Прокрутить вперед",
  "noResultsFoundLabel": "Результаты не найдены",
  "copyActionTooltip": "Скопировать в буфер обмена",
  "cutActionTooltip": "Вырезать и поместить в буфер обмена",
  "pasteActionTooltip": "Вставить содержимое буфера обмена",
  "selectAllActionTooltip": "Выбрать все"
}

lib/l10n/intl_fr.arb Outdated Show resolved Hide resolved
henry2man and others added 2 commits March 8, 2022 09:10
Add initial support for German
@henry2man
Copy link
Contributor Author

So, I translated/reviewed the Hindi language.

@alexmercerind Merged 👏🏻 thanks!!

@zacksleo
Copy link

I've reviewed Simplified Chinese, thanks!

{
  "@@locale": "zh",
  "backButtonTooltip": "返回",
  "closeButtonLabel": "关闭",
  "searchLabel": "搜索",
  "closeNavigationTooltip": "关闭导航",
  "openNavigationTooltip": "打开导航",
  "clickToSearch": "点击搜索",
  "modalBarrierDismissLabel": "取消",
  "minimizeWindowTooltip": "最小化",
  "restoreWindowTooltip": "恢复",
  "closeWindowTooltip": "关闭",
  "dialogLabel": "对话",
  "cutActionLabel": "剪切",
  "copyActionLabel": "复制",
  "pasteActionLabel": "粘贴",
  "selectAllActionLabel": "全选",
  "newTabLabel": "添加新标签",
  "closeTabLabelSuffix": "关闭标签",
  "scrollTabBackwardLabel": "向后滚动标签列表",
  "scrollTabForwardLabel": "向前滚动标签列表",
  "noResultsFoundLabel": "没有找到结果",
  "copyActionTooltip": "将选中的内容复制到剪贴板",
  "cutActionTooltip": "将选中的内容剪切到剪贴板",
  "pasteActionTooltip": "在当前位置插入剪贴板的内容",
  "selectAllActionTooltip": "选择所有内容"
}
  static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
        "backButtonTooltip": MessageLookupByLibrary.simpleMessage("返回"),
        "clickToSearch": MessageLookupByLibrary.simpleMessage("点击搜索"),
        "closeButtonLabel": MessageLookupByLibrary.simpleMessage("关闭"),
        "closeNavigationTooltip": MessageLookupByLibrary.simpleMessage("关闭导航"),
        "closeTabLabelSuffix": MessageLookupByLibrary.simpleMessage("关闭标签"),
        "closeWindowTooltip": MessageLookupByLibrary.simpleMessage("关闭"),
        "copyActionLabel": MessageLookupByLibrary.simpleMessage("复制"),
        "copyActionTooltip":
            MessageLookupByLibrary.simpleMessage("将选中的内容复制到剪贴板"),
        "cutActionLabel": MessageLookupByLibrary.simpleMessage("剪切"),
        "cutActionTooltip":
            MessageLookupByLibrary.simpleMessage("将选中的内容剪切到剪贴板"),
        "dialogLabel": MessageLookupByLibrary.simpleMessage("对话"),
        "minimizeWindowTooltip": MessageLookupByLibrary.simpleMessage("最小化"),
        "modalBarrierDismissLabel": MessageLookupByLibrary.simpleMessage("取消"),
        "newTabLabel": MessageLookupByLibrary.simpleMessage("添加新标签"),
        "noResultsFoundLabel": MessageLookupByLibrary.simpleMessage("没有找到结果"),
        "openNavigationTooltip": MessageLookupByLibrary.simpleMessage("打开导航"),
        "pasteActionLabel": MessageLookupByLibrary.simpleMessage("粘贴"),
        "pasteActionTooltip":
            MessageLookupByLibrary.simpleMessage("在当前位置插入剪贴板的内容"),
        "restoreWindowTooltip": MessageLookupByLibrary.simpleMessage("恢复"),
        "scrollTabBackwardLabel":
            MessageLookupByLibrary.simpleMessage("向后滚动标签列表"),
        "scrollTabForwardLabel":
            MessageLookupByLibrary.simpleMessage("向前滚动标签列表"),
        "searchLabel": MessageLookupByLibrary.simpleMessage("搜索"),
        "selectAllActionLabel": MessageLookupByLibrary.simpleMessage("全选"),
        "selectAllActionTooltip": MessageLookupByLibrary.simpleMessage("选择所有内容")
      };

@henry2man
Copy link
Contributor Author

I've reviewed Simplified Chinese, thanks!

Merged @zacksleo, you're welcomed! 🚀

PS: We only need the contents of the intl_xxx.arb files, the other ones are autogenerated.

@henry2man
Copy link
Contributor Author

I've added detailed instructions in README.md so anyone will be capable of contributing new languages and localizations :)

@henry2man
Copy link
Contributor Author

I'm just waiting the German translation for remove draft mark for this PR.

@bdlukaa
Copy link
Owner

bdlukaa commented Mar 13, 2022

@henry2man can this be marked as ready for review?

@henry2man
Copy link
Contributor Author

henry2man commented Mar 14, 2022

@henry2man can this be marked as ready for review?

I'm still waiting 🤷🏻‍♂️ for #216 (comment) review. If you want to release now, I can remove unverified localizations (de for now)

@bdlukaa
Copy link
Owner

bdlukaa commented Mar 14, 2022

yup. sounds good!

@henry2man henry2man changed the title [WIP] [⭐️Help Needed!] FluentUI Widgets Localization Support FluentUI Widgets Localization Support Mar 14, 2022
lib/l10n/intl_de.arb Outdated Show resolved Hide resolved
@henry2man henry2man marked this pull request as ready for review March 14, 2022 18:58
@henry2man henry2man requested a review from bdlukaa March 14, 2022 18:58
@henry2man
Copy link
Contributor Author

@larsb24 Thanks for your German translation.

@bdlukaa Now it's ready to review & merge 👍🏻

@bdlukaa bdlukaa merged commit 81b2de8 into bdlukaa:master Mar 15, 2022
@henry2man henry2man deleted the FR-i18n-support branch March 15, 2022 17:06
@dmakwt
Copy link
Contributor

dmakwt commented Apr 5, 2022

I translated the Arabic language.
lib/l10n/intl_ar.arb

{
  "@@locale": "ar",
  "backButtonTooltip": "رجوع",
  "closeButtonLabel": "إغلاق",
  "searchLabel": "بحث",
  "closeNavigationTooltip": "إغلاق الواجهة",
  "openNavigationTooltip": "فتح الواجهة",
  "clickToSearch": "انقر للبحث",
  "modalBarrierDismissLabel": "استبعاد",
  "minimizeWindowTooltip": "تصغير",
  "restoreWindowTooltip": "إسترجاع",
  "closeWindowTooltip": "إغلاق",
  "dialogLabel": "مربع حوار",
  "cutActionLabel": "قص",
  "copyActionLabel": "نسخ",
  "pasteActionLabel": "لصق",
  "selectAllActionLabel": "تحديد الكل",
  "newTabLabel": "إضافة علامة تبويب جديدة",
  "closeTabLabelSuffix": "إغلاق علامة التبويب",
  "scrollTabBackwardLabel": "تمرير قائمة علامة التبويب للخلف",
  "scrollTabForwardLabel": "تمرير قائمة علامة التبويب إلى الأمام",
  "noResultsFoundLabel": "لم يتم العثور على نتائج",
  "copyActionTooltip": "انسخ المحتوى المحدد إلى الحافظة",
  "cutActionTooltip": "قم بإزالة المحتوى المحدد وضعه في الحافظة",
  "pasteActionTooltip": "إدراج محتويات الحافظة إلى الموقع الحالي",
  "selectAllActionTooltip": "تحديد المحتوى بالكامل"
}

@henry2man
Copy link
Contributor Author

@dmakwt Great! 🥇Can you create a new pull request like @dubh3 did in #267?

Please follow the instructions here: https://github.com/bdlukaa/fluent_ui#contributing-new-localizations

@dmakwt
Copy link
Contributor

dmakwt commented Apr 5, 2022

@henry2man yes sure 👍 #268

@Dyrkon
Copy link

Dyrkon commented Sep 7, 2022

Hi, I have done a translation into Czech.

{
"@@Locale": "cs",
"backButtonTooltip": "Zpět",
"closeButtonLabel": "Zavřít",
"searchLabel": "Hledat",
"closeNavigationTooltip": "Zavřít navigaci",
"openNavigationTooltip": "Otevřít navigaci",
"clickToSearch": "Kliknout pro vyhledávání",
"modalBarrierDismissLabel": "Zamítnout",
"minimizeWindowTooltip": "Minimalizovat",
"restoreWindowTooltip": "Obnovit",
"closeWindowTooltip": "Zavřít",
"dialogLabel": "Zpráva",
"cutActionLabel": "Vyjmout",
"copyActionLabel": "Kopírovat",
"pasteActionLabel": "Vložit",
"selectAllActionLabel": "Vybrat vše",
"newTabLabel": "Přidat novou záložku",
"closeTabLabelSuffix": "Zavřít záložku",
"scrollTabBackwardLabel": "Posunout záložky zpět",
"scrollTabForwardLabel": "Posunout záložky kupředu",
"noResultsFoundLabel": "Nebyl nalezen žádný výsledek",
"copyActionTooltip": "Zkopírovat vybraný obsah do schránky",
"cutActionTooltip": "Vyjmout vybraný obsah a vložit do schránky",
"pasteActionTooltip": "Vložit obsah schránky na současné místo",
"selectAllActionTooltip": "Vybrat všechen obsah"
}

dev-hann added a commit to dev-hann/fluent_ui that referenced this pull request Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants