Project

General

Profile

Actions

Refactor #3061

closed

Remove copied code from gettext debug helper class

Added by Lukas Zapletal over 10 years ago. Updated about 10 years ago.

Status:
Rejected
Priority:
Low
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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.


Related issues 1 (0 open1 closed)

Related to Foreman - Feature #2942: Plugin i18n supportClosedLukas Zapletal08/16/2013Actions
Actions #1

Updated by Dominic Cleal over 10 years ago

Actions #2

Updated by Greg Sutcliffe over 10 years ago

  • Target version deleted (1.4.0)
Actions #3

Updated by Anonymous over 10 years ago

  • Target version set to 1.10.0
Actions #4

Updated by Lukas Zapletal over 10 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.

Actions #5

Updated by Lukas Zapletal about 10 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.

Actions

Also available in: Atom PDF