How to prevent someone from entering strings without making it available for translation?
-
25-02-2021 - |
Domanda
I am working to make all strings in my plugin ready for translation by putting them under __() or _e() as per requirement. Now in future to avoid others in my team to add strings without making available for translation(bare strings), I want to add a code that runs may be on pushing the code(in my git repository) and throws exception mentioning the bare strings.
Soluzione
There is no way to know if string should be translatable or not (should a 'fail'
in a json response be translatable?). Some things just need proper code review and can not be automated.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a wordpress.stackexchange