Skip to content

Commit

Permalink
Merge pull request #181 from PurpleBooth/piñata-to-pinata
Browse files Browse the repository at this point in the history
Safely transliterate international characters for aliases
  • Loading branch information
mislav committed Jul 31, 2020
2 parents 59ef859 + be99618 commit 2eb30ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ source "https://rubygems.org"

gem "rake", "~> 10.3.2"
gem "minitest", "~> 5.3.5"
gem "i18n", "~> 1.8.5"

gemspec
4 changes: 3 additions & 1 deletion db/dump.rb
Original file line number Diff line number Diff line change
@@ -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__))
Expand Down Expand Up @@ -34,7 +36,7 @@
)
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",
Expand Down

0 comments on commit 2eb30ab

Please sign in to comment.