Geo: Add i18n for replicables in the framework

Follow up on !35443 (comment 375996217):

I'm not sure how bin/rake gettext:regenerate works, but if I wrap _(...) around the titleize calls etc, it doesn't produce this. Maybe _("Package Files") needs to be hard-coded somewhere, but the point of this MR is to avoid hardcoding anything. I don't consider translations of these values to be a high-priority, so if anyone disagrees, I suggest it should be in a separate issue.

As far as I know gettext works by statically parsing the code with what's ultimately regex rules.

This might not be something that can be done dynamically from titleize. 🤔

Proposal

Initial iteration:

  • Use _() method on the following Replicator methods:
      # @return [String] human-readable title of this replicator. E.g. "Package File"
      def self.replicable_title
        _(self.replicable_name.titleize)
      end

      # @return [String] human-readable title of this replicator, pluralized. E.g. "Package Files"
      def self.replicable_title_plural
        _(self.replicable_name.pluralize.titleize)
      end
  • Add any necessary N_() calls to ee/locale/unfound_translations.rb
  • Open follow up issue to add automation (e.g. maybe create a rake task which adds any omitted Geo replicables to unfound_translations.rb, then call this task in CI and compare with the checked in file)
Edited by Michael Kozono