mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
REVERT: removes translate_emoji (#9889)
This API is actually used in some plugins.
This commit is contained in:
parent
1cf2d1f9f2
commit
1d685c22af
@ -126,7 +126,7 @@ class Emoji
|
||||
end
|
||||
|
||||
def self.load_translations
|
||||
db["translations"]
|
||||
db["translations"].merge(Plugin::CustomEmoji.translations)
|
||||
end
|
||||
|
||||
def self.base_directory
|
||||
|
@ -30,6 +30,15 @@ class Plugin::CustomEmoji
|
||||
def self.unregister(name, group = Emoji::DEFAULT_GROUP)
|
||||
emojis[group].delete(name)
|
||||
end
|
||||
|
||||
def self.translations
|
||||
@@translations ||= {}
|
||||
end
|
||||
|
||||
def self.translate(from, to)
|
||||
@@cache_key = Digest::SHA1.hexdigest(cache_key + from)[0..10]
|
||||
translations[from] = to
|
||||
end
|
||||
end
|
||||
|
||||
class Plugin::Instance
|
||||
@ -487,6 +496,10 @@ class Plugin::Instance
|
||||
Emoji.clear_cache
|
||||
end
|
||||
|
||||
def translate_emoji(from, to)
|
||||
Plugin::CustomEmoji.translate(from, to)
|
||||
end
|
||||
|
||||
def automatic_assets
|
||||
css = styles.join("\n")
|
||||
js = javascripts.join("\n")
|
||||
|
Loading…
Reference in New Issue
Block a user