skip to Main Content

Recently we complete a huge application with easy_localization package in flutter
but now I need to check is there any string in project that dose not follow this package rules and not compatible in different locales?
wrong pattern:

"str"
'str'

correct pattern

tr("str")
tr('str')

2

Answers


  1. Chosen as BEST ANSWER

    I solved this issue with these two regular expressions:

    [^(]".*"[^)]
    [^(]'.*'[^)]
    

    that can be tested and improved in regex101 you can use it in vs code like this to find them

    vs code demo
    If you know better way or expression to solve it please inform me at comments


  2. you can just search your project for anything that matches "str" using your editor and confirm it yourself

    I’m not that good at regex but I think this will do it [^(]".*"[^)]

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search