Refactor #3061
closedRemove copied code from gettext debug helper class
Description
The Foreman::Gettext::Debug uses slightly modified versions of D_* methods from fast_gettext 0.8+.
I would like to enable return blocks on these methods so we are able to refactor these into nice code again.
Updated by Dominic Cleal over 11 years ago
- Related to Feature #2942: Plugin i18n support added
Updated by Lukas Zapletal about 11 years ago
- Target version deleted (
1.10.0)
Okay the thing is - I plan to add block support for D_ methods upstream, then we can remove duplicated code in Foreman.
Please do not put this on Sprint until let's say 20, I will need to work upstream first.
Updated by Lukas Zapletal almost 11 years ago
- Status changed from New to Rejected
I wonder if this is worth the effort, these are three methods on three lines, it's only used in gettext debug (mark_translated). Upstream, passing block can cause issues because the multi domain version needs to call it twice - could cause side effects and comparsion could we wrong for some values (e.g. new instance returned).
def D_(key) FastGettext.translation_repositories.each_key do |domain| result = FastGettext::TranslationMultidomain.d_(domain, key) {nil} return result unless result.nil? end key end
In the current upstream code safe value (nil) is used. I am closing this one.