localizely / flutter-intl-vscode

This VS Code extension generates boilerplate code for localization of Flutter apps with official Dart Intl library
MIT License
87 stars 1 forks source link

Escaping single quote is not working #119

Open omar-azzam00 opened 1 month ago

omar-azzam00 commented 1 month ago

When I try to escape a single quote like this:

Capture2

it actually results in two quotes both in the getter S class and in the ui

Capture4

Capture3

can anyone help with this ? I think this may be a bug in the plugin.

lzoran commented 1 month ago

Hi @omar-azzam00,

Does the following approach work for you?

"password_empty_error_msg": "Password can't be empty!"
omar-azzam00 commented 1 month ago

Hello Sir @lzoran,

This actually gives me an error asking me to prefix it with another single quote.

Capture5

lzoran commented 1 month ago

It looks like this issue arises from a conflict between the ARB Editor extension and the Flutter Intl extension when used in conjunction.

According to the ARB Editor extension's documentation, you can deactivate the escaping quotes feature by setting use-escaping to false in your l10n.yaml file. Would that approach resolve your issue?

The l10n.yaml file:

use-escaping: false
Ahnaf16 commented 4 weeks ago

Adding a l10n.yaml file gives me this error when I run pub get.

SCR-20240815-jiud

lzoran commented 3 weeks ago

I see.

The Flutter Intl and gen_l10n are two different tools that generate the necessary localization code for Flutter apps. Between them, there are a few minor differences, mostly regarding metadata, escaping, and similar aspects.

In case you would like to use the Flutter Intl plugin to generate localization code, then I believe you would need to disable the ARB Editor extension for that project, as it reports errors that do not exist for Flutter Intl.

More info: Flutter localization