File: fast_gettext.rb

package info (click to toggle)
ruby-fast-gettext 3.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 668 kB
  • sloc: ruby: 3,200; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

# Iconv will not be defined, unless it is found -> normalize test results for users that have Iconv/those who do not have it
begin; require 'iconv'; rescue StandardError; LoadError; end
initial = methods.count + Module.constants.count

# FastGettext
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
require 'fast_gettext'
FastGettext.locale = 'de'
FastGettext.add_text_domain 'test', path: 'spec/locale'
FastGettext.text_domain = 'test'
include FastGettext::Translation # rubocop:disable Style/MixinUsage
raise unless _('car') == 'Auto'

puts "FastGettext"
puts methods.count + Module.constants.count - initial