> I don't mind adding the strings manually to the .po files. I just want to > have the code compiled. Is there a way to achieve this, other than eval()? > Otherwise, this.tr is not that much useful.
All you can do right now is patch the Generator. Edit the file tool/pylib/generator/action/Locale.py, look for the occurrences of the string "Unsupported param of type", and replace the "raise NameError" in these lines with "self._console.warn". > On the other hand, it's IMO in principle somewhat fishy to have some > perfectly valid code break compilation. You can have code compiled which > calls functions which are unknown to qooxdoo at compile time, but you > can't call this.tr with something which at runtime evaluates to a > perfectly valid key. I'd see the point in a warning, but IMO an error is > not OK. You are absolutely right, please open a bug for it. Mind, though, that with the current implementation, the translation keys from *the code* are relevant for inclusion in the final app, not the keys in the .po files. That means you can add any kind of keys to your .po files, but as long as those keys don't show up in the code, they will not be included. You can work around that by adding the keys *somewhere* in your code, e.g. in some data class or map, using .marktr(). If the argument expression to this.tr() evaluates to one of the keys at run time, the right translation should be returned. T. ------------------------------------------------------------------------------ _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
