Sha256: 8f7d5d57f405352b63a3715025bbace9f3899b57440d89c7ea1379752bf442df
Contents?: true
Size: 1.82 KB
Versions: 2
Compression:
Stored size: 1.82 KB
Contents
= ViziTranslator == Introduction This gem module provides a classes to support the language translation of text files or text strings. The Frengly on-line service requires registration and prvoides access with a username and password. The gem module uses the NET::HTTP library to access the Frengly service. Find out more about the translation service at www.frengly.com. == Installation Just run: gem install vizi_translator The following gems are required 'net/http', 'uri' and 'xmlsimple'. You can install xmlsimple with 'get install xml-simple' This sample application will read a text file for translation. The sample text file is a index markdown file written in English. The English markdown file provides content for Vizitrax's home page. The translated file can be used to replace the English content with content for another language. == Usage require 'vizi_translator' # Set username and password. Username must be registered at Frengly username = "your_username" password = "your_password" # Set target language for translation targetlanguage = "fr" begin # Open test file for translation @test = File.read(Dir.pwd+'./data/index.md') # Initiate Translator class translator = Vizi::Translator.new # Get array with available language codes @langcodes = translator.getcodes # Get hashed list of languages and language codes @langlist = translator.getlist # Call method to do the translation @testnew = translator.gettext(username, password, @test, targetlanguage) end == License This code is made available under the MIT license. All users of this code should read and follow the acceptable use policies for the Frengly translation service.
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vizi_translator-0.5.0 | README.rdoc |
vizi_translator-0.4.0 | README.rdoc |