CLEANUP: remove unused pseudo locale
This commit is contained in:
parent
17f75bbe92
commit
c6bc324259
|
@ -1,3 +0,0 @@
|
|||
//= depend_on 'client.pseudo.yml'
|
||||
//= require locales/i18n
|
||||
<%= JsLocaleHelper.output_locale(:pseudo) %>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -125,7 +125,7 @@ Install RVM
|
|||
# As 'discourse'
|
||||
# Install RVM
|
||||
\curl -s -S -L https://get.rvm.io | bash -s stable
|
||||
|
||||
|
||||
# Refresh your profile
|
||||
. ~/.rvm/scripts/rvm
|
||||
|
||||
|
@ -136,7 +136,7 @@ Install missing packages
|
|||
# rvm requirements
|
||||
|
||||
# NOTE: rvm will tell you which packages you (or your sysadmin) need
|
||||
# to install during this step. As discourse does not have sudo
|
||||
# to install during this step. As discourse does not have sudo
|
||||
# permissions (likely the case), run:
|
||||
|
||||
rvm --autolibs=read-fail requirements
|
||||
|
@ -144,7 +144,7 @@ Install missing packages
|
|||
# For instance, if prompted with `libreadline6-dev libsqlite3-dev sqlite3 autoconf' etc
|
||||
# Install the missing packages with this command, run as your user:
|
||||
# sudo apt-get install libreadline6-dev libsqlite3-dev sqlite3 autoconf
|
||||
# Repeat the autolibs test until you see "Requirements installation successful"
|
||||
# Repeat the autolibs test until you see "Requirements installation successful"
|
||||
|
||||
|
||||
Build and install ruby
|
||||
|
@ -215,7 +215,7 @@ Not english? Set the default language as appropriate:
|
|||
|
||||
# Not sure if your locale is supported? Check at the rails console:
|
||||
LocaleSiteSetting.values
|
||||
=> ["cs", "da", "de", "en", "es", "fr", "id", "it", "nb_NO", "nl", "pseudo", "pt", "ru", "sv", "zh_CN", "zh_TW"]
|
||||
=> ["cs", "da", "de", "en", "es", "fr", "id", "it", "nb_NO", "nl", "pt", "ru", "sv", "zh_CN", "zh_TW"]
|
||||
|
||||
## nginx setup
|
||||
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
MessageFormat.locale.pseudo = function ( n ) {
|
||||
if ( n === 1 ) {
|
||||
return "one";
|
||||
}
|
||||
return "other";
|
||||
};
|
|
@ -1,53 +0,0 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'yaml'
|
||||
|
||||
desc "show the current translation status"
|
||||
task "i18n:generate_pseudolocale" => :environment do
|
||||
|
||||
def pseudolocalize(str)
|
||||
n = 0
|
||||
newstr = ""
|
||||
str.each_char { |c|
|
||||
if c == "{"
|
||||
n += 1
|
||||
elsif c == "}"
|
||||
n -= 1
|
||||
end
|
||||
|
||||
if n < 1
|
||||
newstr += c.tr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
"áƀčďéƒǧĥíʲǩłɱɳóƿƣřšťůνŵхýžÁƁČĎÉƑǦĤÍǰǨŁϺЍÓРƢŘŠŤŮѶŴХÝŽ")
|
||||
else
|
||||
newstr += c
|
||||
end
|
||||
}
|
||||
return "[[ #{newstr} ]]"
|
||||
end
|
||||
|
||||
def transform(p)
|
||||
if p.kind_of?(Hash)
|
||||
newhash = Hash.new
|
||||
p.each { |key, value| newhash[key] = transform(value) }
|
||||
return newhash
|
||||
elsif p.kind_of?(String)
|
||||
return pseudolocalize(p)
|
||||
else
|
||||
raise "Oops, unknown thing in the YML"
|
||||
end
|
||||
end
|
||||
|
||||
def process_file(basename, locale, &block)
|
||||
strings = YAML.load_file("#{Rails.root}/config/locales/#{basename}.#{locale}.yml")
|
||||
new_strings = transform(strings)
|
||||
new_strings = Hash["pseudo" => new_strings[locale]]
|
||||
yield new_strings, strings if block_given?
|
||||
File.open("#{Rails.root}/config/locales/#{basename}.pseudo.yml", 'w+' ) do |f|
|
||||
f.puts new_strings.to_yaml
|
||||
end
|
||||
end
|
||||
|
||||
process_file("client", "en")
|
||||
process_file("server", "en") { |new,orig| new["pseudo"]["time"] = orig["en"]["time"] }
|
||||
|
||||
end
|
|
@ -84,10 +84,6 @@ task "i18n:stats" => :environment do
|
|||
end
|
||||
|
||||
def get_plurals(locale)
|
||||
if locale == "pseudo"
|
||||
locale = "en"
|
||||
end
|
||||
|
||||
I18n.t("i18n.plural.keys", :locale => locale).map { |x| x.to_s }
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue