lib/packnga/reference-task.rb in packnga-0.9.6 vs lib/packnga/reference-task.rb in packnga-0.9.7
- old
+ new
@@ -46,18 +46,29 @@
# This attribute is used to set text files for document.
# @return [Array<String>] target text files
attr_accessor :text_files
# This attribute is used to set the language you wrote original
- # document. Its default value is your current locale.
+ # document. Its default value is "en" (English).
# @return [String] language you used to write document
+ #
+ # @see DocumentTask#original_language=
+ #
+ # @since 0.9.6
attr_accessor :original_language
- # This attribute is used to set languages for tnanslated document.
- # If original_language isn't one, its default value is English.
+ # This attribute is used to set languages for translated document.
+ # If original_language isn't English, its default value is one.
# Otherwise, it is not specified.
+ #
+ # @see DocumentTask#translate_languages=
+ # See this page to specifiy multiple languages to this attribute.
+ # @see DocumentTask#translate_language=
+ # See this page to specifiy a single language to this attribute.
# @return [Array<String>] target languages
+ #
+ # @since 0.9.6
attr_accessor :translate_languages
# @private
def initialize(spec)
@spec = spec
@@ -86,11 +97,11 @@
end
private
def set_default_values
@base_dir ||= Pathname.new("doc")
- @original_language ||= current_language
+ @original_language ||= "en"
if @original_language == "en"
@translate_languages ||= []
else
@translate_languages ||= ["en"]
end
@@ -98,21 +109,9 @@
@po_dir = "#{@base_dir}/po"
@pot_file = "#{@po_dir}/#{@spec.name}.pot"
@extra_files = @text_files
@extra_files += [@readme] if @readme
@files = @source_files + @extra_files
- end
-
- def current_language
- locale = Locale.current
- language = locale.language
- region = locale.region
-
- if region.nil?
- language
- else
- "#{language}_#{region}"
- end
end
def reference_base_dir
@base_dir + "reference"
end