зеркало из https://github.com/github/gemoji.git
Merge pull request #181 from PurpleBooth/piñata-to-pinata
Safely transliterate international characters for aliases
This commit is contained in:
Коммит
2eb30abcd1
1
Gemfile
1
Gemfile
|
@ -2,5 +2,6 @@ source "https://rubygems.org"
|
|||
|
||||
gem "rake", "~> 10.3.2"
|
||||
gem "minitest", "~> 5.3.5"
|
||||
gem "i18n", "~> 1.8.5"
|
||||
|
||||
gemspec
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "i18n"
|
||||
require 'emoji'
|
||||
require 'json'
|
||||
require_relative './emoji-test-parser'
|
||||
|
||||
I18n.config.available_locales = :en
|
||||
items = []
|
||||
|
||||
_, categories = EmojiTestParser.parse(File.expand_path("../../vendor/unicode-emoji-test.txt", __FILE__))
|
||||
|
@ -34,7 +36,7 @@ for category in categories
|
|||
)
|
||||
else
|
||||
output_item.update(
|
||||
aliases: [description.gsub(/\W+/, '_').downcase],
|
||||
aliases: [I18n.transliterate(description).gsub(/\W+/, '_').downcase],
|
||||
tags: [],
|
||||
unicode_version: "13.0",
|
||||
ios_version: "14.0",
|
||||
|
|
Загрузка…
Ссылка в новой задаче