New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide simple debug mode #316
Comments
I want to clarify your question. Are you asking for
The latter is kind of supported if you are running in DEV mode: fbt/runtime/nonfb/FbtTranslations.js Lines 34 to 38 in 53d256d
|
This would be runtime and would affect the output in the actual DOM (production = "My string", development = "[My string]"). This is just for an eyeball test to help catch bugs while developing and ensure necessary strings are being run through the library. If you have ideas on better ways to achieve this goal then that's certainly welcome. |
Oh I see. You can indeed take advantage of the
You pass into
|
Sweet thanks! We actually got it to work through a similar fashion
Please comment if this approach would cause problems |
I don't think that will work. |
It would be useful to provide some sort of debug mode that can slightly alter the output when enabled. This can help devs see strings that are going through fbt and, more importantly, notice strings that are not going through fbt. Perhaps this could be an option in the babel plugins or an option in
init
.A simple proposal, using the
init
route, would be to allow a final string transform function. This would allow devs to create their own format for debug mode, such as wrapping the string in brackets"[this string is translated]"
. I looked into several ways of going about this with the current api, but they are fairly hacky and may break easily.The text was updated successfully, but these errors were encountered: