英文:
how to find unlocalized strings in flutter/ easy_localization
问题
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')
英文:
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')
答案1
得分: 0
我用这两个正则表达式解决了这个问题:
[^(]".*"[^)]
[^(]'.*'[^)]
可以在regex101上进行测试和改进。
你可以在VS Code中像这样使用它们来查找:
如果你知道更好的方法或表达式来解决这个问题,请在评论中告诉我。
英文:
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
If you know better way or expression to solve it
please inform me at comments
答案2
得分: 0
你可以在你的项目中使用编辑器搜索与"str"匹配的内容,自行确认。
我不太擅长正则表达式,但我认为这个表达式应该可以 [^(]"[^"]*"[^)]
。
英文:
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 [^(]".*"[^)]
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论