forked from firka/flutter
Add support for the Kannada (kn) locale (#37026)
This commit is contained in:
@@ -401,3 +401,14 @@ String generateString(String s) {
|
||||
output.write("'");
|
||||
return output.toString();
|
||||
}
|
||||
|
||||
/// Only used to generate localization strings for the Kannada locale ('kn') because
|
||||
/// some of the localized strings contain characters that can crash Emacs on Linux.
|
||||
/// See packages/flutter_localizations/lib/src/l10n/README for more information.
|
||||
String generateEncodedString(String s) {
|
||||
if (s.runes.every((int code) => code <= 0xFF))
|
||||
return generateString(s);
|
||||
|
||||
final String unicodeEscapes = s.runes.map((int code) => '\\u{${code.toRadixString(16)}}').join();
|
||||
return "'$unicodeEscapes'";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user