lib/packnga/document-task.rb in packnga-0.9.6 vs lib/packnga/document-task.rb in packnga-0.9.7

- old
+ new

@@ -46,19 +46,65 @@ @yard_task.base_dir = dir @reference_task.base_dir = dir end # Sets original language which you wrote document. - # Default value is your current locale (Locale.current.to_s). + # Default value is "en" (as English). + # Specified value is used to define language for translation. + # + # @see DocumentTask#translate_languages= #translate_language(s)= is used to specify languages for translation. # @param [String] language language you wrote document + # + # @since 0.9.6 def original_language=(language) @reference_task.original_language = language end + # Sets a translate language for document. + # This method receives String as language code. + # + # @see http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes + # see "639-1" row in this page for lanugage codes. + # + # @example Specify Japanese. + # DocumentTask.new(spec) do |task| + # task.translate_language = "ja" + # end + # + # @!macro [new] document-task.translate_lanuguage.default_value + # If the language specified by {#original_language=} isn't + # English, its default value is one. + # Otherwise, it is not specified. + # + # @see DocumentTask#translate_languages= + # #translate_languages= receives Array of String target languages codes. + # @param [String] language target language code for translated document + # + # @since 0.9.7 + def translate_language=(language) + self.translate_languages = [language] + end + # Sets translate languages for document. - # @param [String] languages languages to translate + # This method receives Array of Strings as each language code. + # + # @see http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes + # see "639-1" row in this page for lanugage codes. + # + # @example Sets Japanese and English. + # DocumentTask.new(spec) do |task| + # task.translate_languages = ["ja", "en"] + # end + # + # @!macro document-task.translate_lanuguage.default_value + # + # @see DocumentTask#translate_language= + # #translate_language= receives String as target language code. + # @param [Array<String>] languages + # target language codes for translated document + # + # @since 0.9.6 def translate_languages=(languages) - languages = [languages] if languages.instance_of?(String) @reference_task.translate_languages = languages end # Runs block to task for YARD documentation. def yard