diff --git a/src/backend/gettext/gettext.cr b/src/backend/gettext/gettext.cr index 6e49851..7d4f908 100644 --- a/src/backend/gettext/gettext.cr +++ b/src/backend/gettext/gettext.cr @@ -1,5 +1,13 @@ require "./**" +# Namespace for logic relating to the [GNU Gettext](https://www.gnu.org/software/gettext/) format +# +# Gettext is typically separated into two files: `.po` and `.mo`. Both of these formats are fully supported +# by Lens with either the `Gettext::MOBackend` or `Gettext::POBackend` backends. +# +# For more information, please see their respective documentations. +# +# All functionality (except flags) of Gettext are implemented. module Gettext extend self diff --git a/src/backend/gettext/mo/backend.cr b/src/backend/gettext/mo/backend.cr index 74ac82e..6e2a64e 100644 --- a/src/backend/gettext/mo/backend.cr +++ b/src/backend/gettext/mo/backend.cr @@ -22,8 +22,8 @@ module Gettext Dir.glob("#{@locale_directory_path}/**/*.mo") do |gettext_file| name = File.basename(gettext_file) if @_source.has_key?(name) - # We're just going to use the end of transmission character to mark files with the same name. This is a major - # back and should be optimized in the future. + # We're just going to use the size of the locale hash to mark files with the same name. This is a major + # hack and should be optimized in the future. @_source[name + @_source.size.to_s] = File.open(gettext_file) else @_source[name] = File.open(gettext_file) diff --git a/src/backend/gettext/po/backend.cr b/src/backend/gettext/po/backend.cr index 9a6ea69..5dd960c 100644 --- a/src/backend/gettext/po/backend.cr +++ b/src/backend/gettext/po/backend.cr @@ -20,8 +20,8 @@ module Gettext Dir.glob("#{@locale_directory_path}/**/*.po") do |gettext_file| name = File.basename(gettext_file) if @_source.has_key?(name) - # We're just going to use the end of transmission character to mark files with the same name. This is a major - # back and should be optimized in the future. + # We're just going to use the size of the locale hash to mark files with the same name. This is a major + # hack and should be optimized in the future. @_source[name + @_source.size.to_s] = File.read(gettext_file) else @_source[name] = File.read(gettext_file)