實際上,我使用 Arb 檔案進行本地化,因為我不知道如何使用 flutter 創建和訪問 .arb 檔案中的陣列型別值
uj5u.com熱心網友回復:
您可以簡單地將物件定義為由一些常見分隔符分隔的字串:
"months": "january:february:march:april:may:june:july:august:september:october:november:december",
"@months": {
"description": "months"
},
然后,將字串拆分為一個陣列:
String monthsString = AppLocalizations.of(context)!.months;
List<String> months = monthsString.split(':');
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/383462.html
