mediawiki-extensions-Visual.../modules/ve-mw/tests/browser/features/support/env.rb
Vikas S Yaligar 8b7b20b934 [BrowserTest] Add true internationalized content support to language screenshot
* All translations will be in tests/browser/i18n folder
* Hebrew json’s are added, which needs to be translated.

Paired with Zeljko.

Bug: T105466
Change-Id: I4ae516758fb01a41f0dcf53c7cf3e609c7601cf3
2015-07-16 14:47:56 -05:00

13 lines
314 B
Ruby

require_relative 'hooks'
require 'mediawiki_selenium'
require 'mediawiki_api'
require 'screenshot'
include MediawikiApi
def translate(string)
file = File.read "i18n/#{ENV['LANGUAGE_SCREENSHOT_CODE']}.json"
json = JSON.parse(file)
json["languagescreenshot-#{string.downcase.gsub(' ', '-')}-text"] || ''
end