Skip to content

Commit

Permalink
Turkish & Kelimelik (#354)
Browse files Browse the repository at this point in the history
* Add turkish Locale and Kelimelik game

* Add translations and handle dictionaries

* Center radio

* Improve translations and flag

* Improve translations

* Improve translations

* Improve crawling
  • Loading branch information
kamilmielnik authored Aug 25, 2024
1 parent 013ecd9 commit 7a6dd4f
Show file tree
Hide file tree
Showing 30 changed files with 329 additions and 28 deletions.
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,27 @@
"keywords": [
"Scrabble",
"Super Scrabble",
"Kelimelik",
"Literaki",
"Solver",
"Finder",
"Cheating",
"Word",
"English",
"Français",
"French",
"Deutsch",
"German",
"Polski",
"Español",
"Polish",
"فارسی",
"Farsi",
"Español",
"Spanish",
"Română",
"Romanian",
"Türkçe",
"Turkish",
"SOWPODS",
"TWL06",
"SJP",
Expand Down
7 changes: 4 additions & 3 deletions packages/configs/src/games/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as literaki } from './literaki';
export { default as scrabble } from './scrabble';
export { default as superScrabble } from './superScrabble';
export * from './kelimelik';
export * from './literaki';
export * from './scrabble';
export * from './superScrabble';
62 changes: 62 additions & 0 deletions packages/configs/src/games/kelimelik.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
import { Game } from '@scrabble-solver/types';

export const kelimelik = {
bingoScore: 30,
blankScore: 0,
blanksCount: 2,
boardSize: 15,
game: Game.Kelimelik,
name: 'Kelimelik',
rackSize: 7,
bonuses: [
{ multiplier: 3, type: BONUS_WORD, x: 2, y: 0 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 5, y: 0 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 9, y: 0 },
{ multiplier: 3, type: BONUS_WORD, x: 12, y: 0 },
{ multiplier: 3, type: BONUS_CHARACTER, x: 1, y: 1 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 6, y: 1 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 8, y: 1 },
{ multiplier: 3, type: BONUS_CHARACTER, x: 13, y: 1 },
{ multiplier: 3, type: BONUS_WORD, x: 0, y: 2 },
{ multiplier: 2, type: BONUS_WORD, x: 7, y: 2 },
{ multiplier: 3, type: BONUS_WORD, x: 14, y: 2 },
{ multiplier: 2, type: BONUS_WORD, x: 3, y: 3 },
{ multiplier: 2, type: BONUS_WORD, x: 11, y: 3 },
{ multiplier: 3, type: BONUS_CHARACTER, x: 4, y: 4 },
{ multiplier: 3, type: BONUS_CHARACTER, x: 10, y: 4 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 0, y: 5 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 5, y: 5 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 9, y: 5 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 14, y: 5 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 1, y: 6 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 6, y: 6 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 8, y: 6 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 13, y: 6 },
{ multiplier: 2, type: BONUS_WORD, x: 2, y: 7 },
{ multiplier: 2, type: BONUS_WORD, x: 12, y: 7 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 1, y: 8 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 6, y: 8 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 8, y: 8 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 13, y: 8 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 0, y: 9 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 5, y: 9 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 9, y: 9 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 14, y: 9 },
{ multiplier: 3, type: BONUS_CHARACTER, x: 4, y: 10 },
{ multiplier: 3, type: BONUS_CHARACTER, x: 10, y: 10 },
{ multiplier: 2, type: BONUS_WORD, x: 3, y: 11 },
{ multiplier: 2, type: BONUS_WORD, x: 11, y: 11 },
{ multiplier: 3, type: BONUS_WORD, x: 0, y: 12 },
{ multiplier: 2, type: BONUS_WORD, x: 7, y: 12 },
{ multiplier: 3, type: BONUS_WORD, x: 14, y: 12 },
{ multiplier: 3, type: BONUS_CHARACTER, x: 1, y: 13 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 6, y: 13 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 8, y: 13 },
{ multiplier: 3, type: BONUS_CHARACTER, x: 13, y: 13 },
{ multiplier: 3, type: BONUS_WORD, x: 2, y: 14 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 5, y: 14 },
{ multiplier: 2, type: BONUS_CHARACTER, x: 9, y: 14 },
{ multiplier: 3, type: BONUS_WORD, x: 12, y: 14 },
],
};
4 changes: 1 addition & 3 deletions packages/configs/src/games/literaki.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
import { Game } from '@scrabble-solver/types';

const literaki = {
export const literaki = {
bingoScore: 50,
blankScore: 0,
blanksCount: 2,
Expand Down Expand Up @@ -105,5 +105,3 @@ const literaki = {
{ multiplier: 3, score: 5, type: BONUS_CHARACTER, x: 14, y: 14 },
],
};

export default literaki;
4 changes: 1 addition & 3 deletions packages/configs/src/games/scrabble.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
import { Game } from '@scrabble-solver/types';

const scrabble = {
export const scrabble = {
bingoScore: 50,
blankScore: 0,
blanksCount: 2,
Expand Down Expand Up @@ -73,5 +73,3 @@ const scrabble = {
{ multiplier: 3, type: BONUS_WORD, x: 14, y: 14 },
],
};

export default scrabble;
4 changes: 1 addition & 3 deletions packages/configs/src/games/superScrabble.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
import { Game } from '@scrabble-solver/types';

const superScrabble = {
export const superScrabble = {
bingoScore: 50,
blankScore: 0,
blanksCount: 4,
Expand Down Expand Up @@ -136,5 +136,3 @@ const superScrabble = {
{ multiplier: 4, type: BONUS_WORD, x: 20, y: 20 },
],
};

export default superScrabble;
1 change: 1 addition & 0 deletions packages/configs/src/languages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export * from './persian';
export * from './polish';
export * from './romanian';
export * from './spanish';
export * from './turkish';
75 changes: 75 additions & 0 deletions packages/configs/src/languages/turkish.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { Config, Locale } from '@scrabble-solver/types';

import { kelimelik, scrabble } from '../games';

export const turkishKelimelik = new Config({
...kelimelik,
locale: Locale.TR_TR,
tiles: [
{ character: 'a', count: 12, score: 1 },
{ character: 'b', count: 2, score: 3 },
{ character: 'c', count: 2, score: 4 },
{ character: 'ç', count: 2, score: 4 },
{ character: 'd', count: 2, score: 3 },
{ character: 'e', count: 8, score: 1 },
{ character: 'f', count: 1, score: 7 },
{ character: 'g', count: 1, score: 5 },
{ character: 'ğ', count: 1, score: 8 },
{ character: 'h', count: 1, score: 5 },
{ character: 'ı', count: 4, score: 2 },
{ character: 'i', count: 7, score: 1 },
{ character: 'j', count: 1, score: 10 },
{ character: 'k', count: 7, score: 1 },
{ character: 'l', count: 7, score: 1 },
{ character: 'm', count: 4, score: 2 },
{ character: 'n', count: 5, score: 1 },
{ character: 'o', count: 3, score: 2 },
{ character: 'ö', count: 1, score: 7 },
{ character: 'p', count: 1, score: 5 },
{ character: 'r', count: 6, score: 1 },
{ character: 's', count: 3, score: 2 },
{ character: 'ş', count: 2, score: 4 },
{ character: 't', count: 5, score: 1 },
{ character: 'u', count: 3, score: 2 },
{ character: 'ü', count: 2, score: 3 },
{ character: 'v', count: 1, score: 7 },
{ character: 'y', count: 2, score: 3 },
{ character: 'z', count: 2, score: 4 },
],
});

export const turkishScrabble = new Config({
...scrabble,
locale: Locale.TR_TR,
tiles: [
{ character: 'a', count: 12, score: 1 },
{ character: 'b', count: 2, score: 3 },
{ character: 'c', count: 2, score: 4 },
{ character: 'ç', count: 2, score: 4 },
{ character: 'd', count: 2, score: 3 },
{ character: 'e', count: 8, score: 1 },
{ character: 'f', count: 1, score: 7 },
{ character: 'g', count: 1, score: 5 },
{ character: 'ğ', count: 1, score: 8 },
{ character: 'h', count: 1, score: 5 },
{ character: 'ı', count: 4, score: 2 },
{ character: 'i', count: 7, score: 1 },
{ character: 'j', count: 1, score: 10 },
{ character: 'k', count: 7, score: 1 },
{ character: 'l', count: 7, score: 1 },
{ character: 'm', count: 4, score: 2 },
{ character: 'n', count: 5, score: 1 },
{ character: 'o', count: 3, score: 2 },
{ character: 'ö', count: 1, score: 7 },
{ character: 'p', count: 1, score: 5 },
{ character: 'r', count: 6, score: 1 },
{ character: 's', count: 3, score: 2 },
{ character: 'ş', count: 2, score: 4 },
{ character: 't', count: 5, score: 1 },
{ character: 'u', count: 3, score: 2 },
{ character: 'ü', count: 2, score: 3 },
{ character: 'v', count: 1, score: 7 },
{ character: 'y', count: 2, score: 3 },
{ character: 'z', count: 2, score: 4 },
],
});
4 changes: 2 additions & 2 deletions packages/constants/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export const EMPTY_CELL = ' ';

export const NO_BONUS = { characterMultiplier: 1, wordMultiplier: 1 };

export const CONSONANTS = 'bcćdfghjklłmnńñpqrsśtvwxzźż'.split('');
export const CONSONANTS = 'bcçćdfgğhjklłmnńñpqrsşśtvwxzźż'.split('');

export const VOWELS = 'aąäeęioóöuüy'.split('');
export const VOWELS = 'aąäeęioóöuüyı'.split('');
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ $radio-box-size: $radio-size + 2 * $radio-inner-border;
&::after {
content: ' ';
position: absolute;
top: $radio-inner-border;
left: $radio-inner-border;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: $radio-inner-size;
height: $radio-inner-size;
background-color: transparent;
Expand Down
13 changes: 12 additions & 1 deletion packages/scrabble-solver/src/i18n/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { COMMA_ARABIC, COMMA_LATIN } from '@scrabble-solver/constants';
import { Locale } from '@scrabble-solver/types';
import { FunctionComponent, SVGAttributes } from 'react';

import { FlagDe, FlagEs, FlagFa, FlagFr, FlagGb, FlagPl, FlagRo, FlagUs } from 'icons';
import { FlagDe, FlagEs, FlagFa, FlagFr, FlagGb, FlagPl, FlagRo, FlagTr, FlagUs } from 'icons';

interface LocaleFeatures {
comma: string;
Expand Down Expand Up @@ -105,4 +105,15 @@ export const LOCALE_FEATURES: Record<Locale, LocaleFeatures> = {
separator: `${COMMA_LATIN} `,
vowels: true,
},
[Locale.TR_TR]: {
comma: COMMA_LATIN,
consonants: true,
direction: 'ltr',
Icon: FlagTr,
label: 'Türkçe',
locale: Locale.TR_TR,
name: 'Turkish',
separator: `${COMMA_LATIN} `,
vowels: true,
},
};
2 changes: 2 additions & 0 deletions packages/scrabble-solver/src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import persian from './languages/persian.json';
import polish from './languages/polish.json';
import romanian from './languages/romanian.json';
import spanish from './languages/spanish.json';
import turkish from './languages/turkish.json';

const i18n: Record<Locale, Translations> = {
[Locale.DE_DE]: german,
Expand All @@ -19,6 +20,7 @@ const i18n: Record<Locale, Translations> = {
[Locale.FR_FR]: french,
[Locale.PL_PL]: polish,
[Locale.RO_RO]: romanian,
[Locale.TR_TR]: turkish,
};

export default i18n;
78 changes: 78 additions & 0 deletions packages/scrabble-solver/src/i18n/languages/turkish.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"cell.enter-word": "Kelimeyi girin",
"cell.filter-cell.exclude": "Hedefi hariç tut",
"cell.filter-cell.include": "Hedef varış noktası",
"cell.set-blank": "Boş olarak işaretle",
"cell.set-not-blank": "Boş değil olarak işaretle",
"cell.tile.location": "Tahta: harfler ({{x}}, {{y}})",
"cell.toggle-direction": "Yazma yönü - geçiş yapmak için tıklayın",
"common.arrows": "Ok tuşları",
"common.blanks": "Jokerler",
"common.clear": "Sıfırla",
"common.close": "Kapat",
"common.consonants": "Ünlü harfler",
"common.loading": "Yükleniyor",
"common.next": "Sonraki",
"common.points": "Puanlar",
"common.previous": "Öncesi",
"common.space": "Boşluk çubuğu",
"common.tiles": "Taşlar",
"common.two-letter-tiles": "İki Harfli",
"common.vowels": "Ünsüz harfler",
"common.word": "Kelime",
"common.words": "Kelimeler",
"dictionary": "Sözlük",
"dictionary.empty-state.no-definitions": "Kelime sözlükte var ama tanımı yok.",
"dictionary.empty-state.no-results": "Sözlükte kelime tanımı bulunamadı.",
"dictionary.empty-state.not-allowed": "Bu kelimeye izin verilmiyor.",
"dictionary.empty-state.uninitialized": "En son vurgulanan kelimenin sözlük tanımı burada gösterilecektir.",
"dictionary.input.placeholder": "Sözlükte ara...",
"dictionary.input.title": "Virgülle ayrılmış kelimeler",
"empty-state.error": "Hata",
"empty-state.info": "Bilgi",
"empty-state.success": "Evet!",
"empty-state.warning": "Aman hayır!",
"github": "GitHub'da bu projeye bakın",
"keyMap": "Klavye Kısayolları",
"keyMap.board": "Tahta",
"keyMap.board.toggle-blank": "Taşı joker olarak işaretle/olmaktan çıkar",
"keyMap.board.toggle-cell-filter": "Hedef filtresini değiştir",
"keyMap.board.toggle-direction": "Yazma yönünü değiştir",
"keyMap.board-and-rack": "Tahta ve Deste",
"keyMap.board-and-rack.insert-two-letter-tile": "İki harfli kutucuğu ekle",
"keyMap.board-and-rack.navigate": "Gezinme",
"keyMap.board-and-rack.remove-tile": "Taşı kaldır",
"keyMap.board-and-rack.submit": "Çözmeye başla",
"keyMap.rack": "Deste",
"keyMap.rack.insert-blank": "Joker ekle (spacebar)",
"menu": "Menü",
"rack.placeholder": "Taşlar…",
"rack.tile.location": "Deste: harfler ({{index}})",
"rack.touchscreen.placeholder": "Taşlar…",
"remaining-tiles": "Kalan taşlar",
"results": "Sonuçlar",
"results.empty-state.no-results": "Sonuç bulunamadı - kelime üretilemedi.",
"results.empty-state.outdated": "Sonuçlar güncelliğini yitirmiştir.",
"results.empty-state.uninitialized": "Harflerinizden oluşturulan kelimeler burada gösterilecektir.",
"results.input.placeholder": "Sonuçları Ara... (RegExp)",
"results.insert": "Sokmak",
"results.preview": "Önizleme",
"results.solve": "Çöz",
"settings": "Ayarlar",
"settings.autoGroupTiles": "Kalan taşları grupla",
"settings.autoGroupTiles.left": "Soldaki",
"settings.autoGroupTiles.right": "Sağdaki",
"settings.autoGroupTiles.null": "Gruplamayın",
"settings.game": "Oyun",
"settings.inputMode": "Giriş Methodu",
"settings.inputMode.keyboard": "Klavye",
"settings.inputMode.touchscreen": "Dokunmatik ekran",
"settings.language": "Dil",
"settings.showCoordinates": "Koordinatlar",
"settings.showCoordinates.alternative": "Alternatif",
"settings.showCoordinates.hidden": "Gizlenmiş",
"settings.showCoordinates.original": "Orijinal",
"words": "Oluşturulan kelimeler",
"words.invalid": "Geçersiz",
"words.valid": "Geçerli"
}
4 changes: 4 additions & 0 deletions packages/scrabble-solver/src/icons/FlagTr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/scrabble-solver/src/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export { default as FlagFr } from './FlagFr.svg';
export { default as FlagGb } from './FlagGb.svg';
export { default as FlagPl } from './FlagPl.svg';
export { default as FlagRo } from './FlagRo.svg';
export { default as FlagTr } from './FlagTr.svg';
export { default as FlagUs } from './FlagUs.svg';
export { default as GeoAlt } from './GeoAlt.svg';
export { default as Github } from './Github.svg';
Expand Down
Loading

0 comments on commit 7a6dd4f

Please sign in to comment.