How to escape single quote in flutter's localization file?
548
As of i see we can 2 solutions,
- using "" quotes instaed ''
String get modal => r"Tibo\'o";
- changing your code like
String get variableName => 'Tibo\'o';
Author by
Admin
Updated on December 26, 2022Comments
-
Admin over 1 year
I am creating dart's localisation file for my language by following flutter's Adding support for a new language. Unfortunately the file seems not to accept the usual escape character (\) for single quote (') that is frequently used in my language (see the screenshot below). What is the properly way to escape the character (') in this localization file?
-
Admin over 3 yearsThank you @balaji-venkatraman The first solution removes the error.
-
Admin over 3 yearsI still do not have enough reputation to upvote, sorry. On the other hand the solution works but I haven't been able to make the whole localization for a new language work.
-
Balaji Venkatraman over 3 yearswhat is the issue that you are facing
-
Admin over 3 yearsI followed the instruction the official flutter's Adding support for a new language to create locale for my language (nia for Nias). However flutter throws exception invalid locale, as flutter looks in the database of supported locales instead of checking the local file created above (NiaMaterialLocalizations.delegate). Still no idea how to progress. I hope to find any example other people from non-supported locales had done.