mirror of
https://github.com/toptal/gitignore.io.git
synced 2021-05-12 18:32:24 +03:00
Changing localisation logic and removing duplicate files (#525)
This commit is contained in:
9
Localizations/README.md
Normal file
9
Localizations/README.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Localizations
|
||||||
|
|
||||||
|
1. Copy the `en.json` file and rename it
|
||||||
|
_use the base version of the language (en) instead of a country specific version (en_US)_
|
||||||
|
2. Replace the strings with the language you're translating
|
||||||
|
3. Add the language to `Sources/App/Extensions/Router+Extensions.swift` under `supportedLanguages`
|
||||||
|
4. Create a pull request to get your translation approved and merged
|
||||||
|
|
||||||
|
Thank you for help with localizing gitignore
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - Erstelle nützliche .gitignore Dateien Für Dein Projekt",
|
|
||||||
"description": "Erstelle nützliche .gitignore Dateien für dein Projekt in dem du eines von {templateCount} Betriebssystem, Entwicklungsumgebung und Programmiersprache .gitignore Templates wählst",
|
|
||||||
"subtitle": "Erstelle nützliche .gitignore Dateien für dein Projekt",
|
|
||||||
"searchPlaceholder": "Suche nach Betriebssystemen, Entwicklungsumgebungen oder Programmiersprachen",
|
|
||||||
"searchGo": "Create",
|
|
||||||
"searchDownload": "Datei herunterladen",
|
|
||||||
"footer": "%{templateCount} Betriebssystem, Entwicklungsumgebung und Programmiersprache .gitignore Templates",
|
|
||||||
"commandLineTitle": "Kommandozeilen Dokumentation",
|
|
||||||
"commandLineDescription": "Lerne wie man .gitignore.io von der Kommandozeile ausführt",
|
|
||||||
"videoTitle": "Schau das Video Tutorial",
|
|
||||||
"videoDescription": "Schau ein Video um zu lernen wie .gitignore.io funktioniert",
|
|
||||||
"sourceCodeTitle": "Quellcode",
|
|
||||||
"sourceCodeDescription": "Der Quellcode für .gitignore.io ist bei Github gehosted"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - فایل های .gitignore پروژه تان را بسازید",
|
|
||||||
"description": "فایل های .gitignore پروژه تان را با استفاده از %{templateCount} قالب بنا به سیستم عامل، IDE و زیان برنامه نویسی بسازید.",
|
|
||||||
"subtitle": "فایل های .gitignore پروژه تان را بسازید",
|
|
||||||
"searchPlaceholder": "سیستم عامل، IDE و یا زبان برنامه نویسی تان را جستجو کنید.",
|
|
||||||
"searchGo": "ایجاد",
|
|
||||||
"searchDownload": "دانلود فایل",
|
|
||||||
"footer": "%{templateCount} قالب سیستم عامل، IDE و زبان برنامه نویسی",
|
|
||||||
"commandLineTitle": "مستندات خط فرمان",
|
|
||||||
"commandLineDescription": "آموزش چگونگی استفاده از .gitignore.io در خط فرمان",
|
|
||||||
"videoTitle": "تماشای ویدئو آموزشی",
|
|
||||||
"videoDescription": "تماشای ویدئو آموزشی برای اینکه بدانیم .gitignore.io چگونه کار می کند.",
|
|
||||||
"sourceCodeTitle": "منبع کد",
|
|
||||||
"sourceCodeDescription": "میزبانی شده توسط Github"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - Créez des fichiers .gitignore utiles à votre Projet",
|
|
||||||
"description": "Créez des fichiers .gitignore utiles à votre projet en choisissant l'un des %{templateCount} templates .gitignore.io de Système d'exploitation, IDE et Langage de Programmation",
|
|
||||||
"subtitle": "Créez des fichiers .gitignore utiles à votre projet",
|
|
||||||
"searchPlaceholder": "Recherchez des Systèmes d'Exploitation, IDEs ou Langages de Programmation",
|
|
||||||
"searchGo": "Créer",
|
|
||||||
"searchDownload": "Téléchargement du fichier",
|
|
||||||
"footer": "%{templateCount} templates .gitignore.io de Système d'exploitation, IDE et Langage de Programmation",
|
|
||||||
"commandLineTitle": "Documentation",
|
|
||||||
"commandLineDescription": "Apprenez comment utiliser .gitignore.io en ligne de commande",
|
|
||||||
"videoTitle": "Regardez une Vidéo Didacticielle",
|
|
||||||
"videoDescription": "Regardez une vidéo pour apprendre comment fonctionne .gitignore.io",
|
|
||||||
"sourceCodeTitle": "Code Source",
|
|
||||||
"sourceCodeDescription": "Le code source de .gitignore.io est hébergé par GitHub"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - Buat File .gitignore yang Berguna untuk Proyek Anda",
|
|
||||||
"description": "Buat file .gitignore yang berguna untuk proyek anda dengan memilih template .gitginore dari %{templateCount} Sistem Operasi, IDE, dan Bahasa Pemrograman",
|
|
||||||
"subtitle": "Buat file .gitignore yang berguna untuk proyek anda",
|
|
||||||
"searchPlaceholder": "Cari Sistem Operasi, IDE, atau Bahasa Pemrograman",
|
|
||||||
"searchGo": "Buat",
|
|
||||||
"searchDownload": "Mengunduh File",
|
|
||||||
"footer": "template .gitignore %{templateCount} Sistem Operasi, IDE, dan Bahasa Pemrograman",
|
|
||||||
"commandLineTitle": "Dokumentasi Command Line",
|
|
||||||
"commandLineDescription": "Pelajari cara menjalankan .gitignore.io dari Command Line",
|
|
||||||
"videoTitle": "Menonton Video Tutorial",
|
|
||||||
"videoDescription": "Menonton video untuk mempelajari bagaimana .gitignore.io bekerja",
|
|
||||||
"sourceCodeTitle": "Kode Sumber",
|
|
||||||
"sourceCodeDescription": "GitHub menghosting kode sumber untuk .gitignore.io"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - プロジェクトに役立つ.gitignoreファイルを作成しよう",
|
|
||||||
"description": "%{templateCount} オペレーティングシステム、IDE、およびプログラミング言語の.gitignoreテンプレートから選択して、プロジェクトに役立つ.gitignoreファイルを作成しよう。",
|
|
||||||
"subtitle": "プロジェクトに役立つ.gitignoreファイルを作成しよう",
|
|
||||||
"searchPlaceholder": "オペレーティングシステム、IDE、プログラミング言語を検索する",
|
|
||||||
"searchGo": "作成する",
|
|
||||||
"searchDownload": "ファイルをダウンロードする",
|
|
||||||
"footer": "%{templateCount} オペレーティングシステム、IDE、プログラミング言語の.gitignoreテンプレート",
|
|
||||||
"commandLineTitle": "コマンドラインド ドキュメンテーション",
|
|
||||||
"commandLineDescription": "コマンドラインから.gitignore.ioを実行する方法を学ぶ",
|
|
||||||
"videoTitle": "チュートリアルビデオを見る",
|
|
||||||
"videoDescription": ".gitignore.ioがどのように機能するかを学ぶためにビデオを見る",
|
|
||||||
"sourceCodeTitle": "ソースコード",
|
|
||||||
"sourceCodeDescription": ".gitignore.ioのGitHubホストソースコード"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - 자신의 프로젝트에 꼭 맞는 .gitignore 파일을 만드세요",
|
|
||||||
"description": "자신의 프로젝트에 꼭 맞는 .gitignore 파일을 만드세요. %{templateCount} 개의 운영체제, 개발 환경(IDE), 프로그래밍 언어 .gitignore 템플릿이 준비되어 있습니다",
|
|
||||||
"subtitle": "자신의 프로젝트에 꼭 맞는 .gitignore 파일을 만드세요",
|
|
||||||
"searchPlaceholder": "운영체제, 개발 환경(IDE), 프로그래밍 언어 검색",
|
|
||||||
"searchGo": "생성",
|
|
||||||
"searchDownload": "파일 다운로드",
|
|
||||||
"footer": "%{templateCount} 개의 운영체제, 개발 환경(IDE), 프로그래밍 언어 .gitignore 템플릿",
|
|
||||||
"commandLineTitle": "커맨드라인 문서",
|
|
||||||
"commandLineDescription": ".gitignore.io 를 커맨드 라인에서 실행하는 법 배우기",
|
|
||||||
"videoTitle": "동영상 튜토리얼 보기",
|
|
||||||
"videoDescription": ".gitignore.io 가 어떻게 동작하는지 동영상으로 배우기",
|
|
||||||
"sourceCodeTitle": "소스 코드",
|
|
||||||
"sourceCodeDescription": "깃헙(GitHub)에서 호스팅하는 .gitignore.io 소스 코드"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - Crie Arquivos .gitignore Úteis Para Seu Projeto.",
|
|
||||||
"description": "Crie arquivos .gitignore úteis para o seu projeto selecionando os %{templateCount} templates de Sistemas Operacionais, IDEs e linguagens de Programação.",
|
|
||||||
"subtitle": "Crie arquivos .gitignore úteis para o seu projeto.",
|
|
||||||
"searchPlaceholder": "Pesquise Sistemas Operacionais, IDEs ou Linguagens de Programação.",
|
|
||||||
"searchGo": "Criar",
|
|
||||||
"searchDownload": "Baixar Arquivo",
|
|
||||||
"footer": "%{templateCount} Templates de .gitignore de Sistemas Operacionais, IDEs e Linguagens de Programação.",
|
|
||||||
"commandLineTitle": "Documentação",
|
|
||||||
"commandLineDescription": "Saiba como executar o .gitignore.io a partir da Linha de Comando",
|
|
||||||
"videoTitle": "Assista ao Vídeo Tutorial",
|
|
||||||
"videoDescription": "Assista a um vídeo para aprender como funciona o .gitignore.io",
|
|
||||||
"sourceCodeTitle": "Código-fonte",
|
|
||||||
"sourceCodeDescription": "Código-fonte hospedado no GitHub"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - Creează fișiere .gitignore utile pentru proiectul tău",
|
|
||||||
"description": "Creează fișiere .gitignore utile pentru proiectul tău selectând dintre %{templateCount} de șabloane .gitignore pentru sisteme de operare, IDE-uri și limbaje de programare.",
|
|
||||||
"subtitle": "Creează fișiere .gitignore utile pentru proiectul tău",
|
|
||||||
"searchPlaceholder": "Caută sisteme de operare, IDE-uri sau limbaje de programare",
|
|
||||||
"searchGo": "Creează",
|
|
||||||
"searchDownload": "Descarcă fișier",
|
|
||||||
"footer": "%{templateCount} de șabloane .gitignore pentru sisteme de operare, IDE-uri și limbaje de programare",
|
|
||||||
"commandLineTitle": "Documentație linie de comandă",
|
|
||||||
"commandLineDescription": "Află cum să rulezi .gitignore.io din linie de comandă",
|
|
||||||
"videoTitle": "Vizionează tutorialul video",
|
|
||||||
"videoDescription": "Vizionează videoul să vezi cum funcționează .gitignore.io",
|
|
||||||
"sourceCodeTitle": "Cod sursă",
|
|
||||||
"sourceCodeDescription": "GitHub a găzduit codul sursă pentru .gitignore.io"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - Генерируйте удобные .gitignore файлы для вашего проекта",
|
|
||||||
"description": "Генерируйте удобные .gitignore файлы для вашего проекта при помощи выбора из %{templateCount} шаблонов файла .gitignore для различных операционных систем, IDE и языков программирования",
|
|
||||||
"subtitle": "Генерируйте удобные .gitignore файлы для вашего проекта",
|
|
||||||
"searchPlaceholder": "Искать по операционным системам, IDE или языкам программирования",
|
|
||||||
"searchGo": "Сгенерировать",
|
|
||||||
"searchDownload": "Скачать файл",
|
|
||||||
"footer": "%{templateCount} шаблонов файла .gitignore для различных операционных систем, IDE и языков программирования",
|
|
||||||
"commandLineTitle": "Документация по работе из командной строки",
|
|
||||||
"commandLineDescription": "Изучите, как запускать .gitignore.io из командной строки",
|
|
||||||
"videoTitle": "Смотреть видео-туториал",
|
|
||||||
"videoDescription": "Смотреть видео, рассказывающее, как работает .gitignore.io",
|
|
||||||
"sourceCodeTitle": "Исходный код",
|
|
||||||
"sourceCodeDescription": "Исходный код .gitignore.io на GitHub"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - Projen İçin İşe Yarar .gitignore Dosyaları Yarat",
|
|
||||||
"description": "%{templateCount} İşletim Sistemi, IDE, ve Programlama Dili için .gitignore şablonlarından seçerek projen için işe yarar .gitignore dosyaları yarat",
|
|
||||||
"subtitle": "Projen için işe yarar .gitignore dosyaları yarat",
|
|
||||||
"searchPlaceholder": "İşletim Sistemleri, IDE'ler, ya da Programlama Dilleri ara",
|
|
||||||
"searchGo": "Yarat",
|
|
||||||
"searchDownload": "Dosyayı İndir",
|
|
||||||
"footer": "%{templateCount} İşletim Sistemi, IDE, ve Programlama Dili için .gitignore şablonları",
|
|
||||||
"commandLineTitle": "Komut Satırı Kılavuzu",
|
|
||||||
"commandLineDescription": ".gitignore.io'u komut satırından çalıştırmayı öğren",
|
|
||||||
"videoTitle": "Öğretici Videoyu İzle",
|
|
||||||
"videoDescription": ".gitignore.io'nun nasıl çalıştığını öğrenmek için bir video izle",
|
|
||||||
"sourceCodeTitle": "Kaynak Kod",
|
|
||||||
"sourceCodeDescription": "GitHub'da tutulan .gitignore.io'un kaynak kodu"
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "gitignore.io - 为你的项目创建必要的 .gitignore 文件",
|
|
||||||
"description": "从 %{templateCount} 操作系统, IDE, 和编程语言的 .gitignore 模板中为你的项目创建必要的 .gitignore 文件",
|
|
||||||
"subtitle": "为你的项目创建必要的 .gitignore 文件",
|
|
||||||
"searchPlaceholder": "搜索操作系统, IDEs, 或编程语言",
|
|
||||||
"searchGo": "创建",
|
|
||||||
"searchDownload": "文件下载",
|
|
||||||
"footer": "%{templateCount} 操作系统, IDE, 和编程语言的 .gitignore 模板",
|
|
||||||
"commandLineTitle": "命令行使用文档",
|
|
||||||
"commandLineDescription": "学习如何从命令行运行 .gitignore.io",
|
|
||||||
"videoTitle": "观看视频教程",
|
|
||||||
"videoDescription": "通过视频学习 .gitignore.io 是如何工作的",
|
|
||||||
"sourceCodeTitle": "源码",
|
|
||||||
"sourceCodeDescription": ".gitignore.io 的源码托管在 github 上"
|
|
||||||
}
|
|
||||||
@@ -10,23 +10,19 @@ import Vapor
|
|||||||
extension Request {
|
extension Request {
|
||||||
var acceptLanguage: String {
|
var acceptLanguage: String {
|
||||||
get {
|
get {
|
||||||
guard let accpetLanguage = self.http
|
let acceptLanguage = String(self.http
|
||||||
.headers
|
.headers
|
||||||
.firstValue(name: .acceptLanguage)?
|
.firstValue(name: .acceptLanguage)?
|
||||||
.split(separator: ",")
|
.split(separator: ",")
|
||||||
.first else {
|
.first?
|
||||||
|
.split(separator: "-")
|
||||||
|
.first ?? "en")
|
||||||
|
let supportedLanguages = ["ar", "de", "en", "fa", "fr", "id", "ja", "ko", "pt", "ro", "ru", "tr", "zh"]
|
||||||
|
if supportedLanguages.contains(acceptLanguage) {
|
||||||
|
return acceptLanguage
|
||||||
|
} else {
|
||||||
return "en"
|
return "en"
|
||||||
}
|
}
|
||||||
switch accpetLanguage {
|
|
||||||
case "en-US", "en-us": return "en"
|
|
||||||
case "de-DE", "de-de": return "de_DE"
|
|
||||||
case "pt-BR", "pt-br": return "pt_BR"
|
|
||||||
case "ko-KR", "ko-kr": return "ko_KR"
|
|
||||||
case "ro-RO", "ro-ro": return "ro_RO"
|
|
||||||
case "tr-TR", "tr-tr": return "tr_TR"
|
|
||||||
case "ar": return "ar"
|
|
||||||
default: return "en"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user