Skip to content

Commit

Permalink
fix(chore): change to snake_case translation keys
Browse files Browse the repository at this point in the history
  • Loading branch information
syradar committed Jul 2, 2023
1 parent 5ac0e82 commit 49bee09
Show file tree
Hide file tree
Showing 89 changed files with 6,929 additions and 6,341 deletions.
10 changes: 5 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ const AppToolbar = () => {
buttonType="ghost"
onPress={() => dispatch(previousDay())}
>
{t('calendar:previousDay')}
{t('calendar:previous_day')}
</ParchmentButton>
<ParchmentButton
small
buttonType="ghost"
onPress={() => dispatch(nextDay())}
>
{t('calendar:nextDay')}
{t('calendar:next_day')}
</ParchmentButton>
</div>
</div>
Expand Down Expand Up @@ -107,12 +107,12 @@ const AppMenu = () => {
</Link>
{!isLg ? (
<ParchmentButton buttonType="ghost" small onPress={handleMenuClick}>
{t('core:menu.Menu')}
{t('core:menu.menu')}
</ParchmentButton>
) : null}
</div>
{isOpen || isLg ? (
<div className="flex flex-col justify-between gap-4">
<div className="flex h-full flex-col justify-between gap-4">
<Stack.Vertical wrap={false} spacing="small">
<Menu close={closeMenu} menuRoutes={menuRoutes} />
</Stack.Vertical>
Expand All @@ -124,7 +124,7 @@ const AppMenu = () => {
className="mb-4 mt-auto text-center hover:text-red-700 hover:underline"
href="https://github.com/syradar/yxans-klagan/issues/new/choose"
>
{t('core:GiveFeedback')}
{t('core:give_feedback')}
</a>
</div>
</div>
Expand Down
45 changes: 26 additions & 19 deletions src/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,48 +36,48 @@ type MenuRoute = {
export const menuRoutes: MenuRoute[] = [
{
path: '',
label: 'core:menu.Menu',
label: 'core:menu.menu',
id: nanoid(),
element: <HomePage />,
},
{
path: 'session',
id: nanoid(),
label: 'core:menu.Session',
label: 'core:menu.session',
element: <SessionPage />,
},
{
path: 'encounter',
id: nanoid(),
label: 'core:menu.Encounters',
label: 'core:menu.encounters',
element: <EncounterPage />,
},
{
path: 'monsters',
showInMenu: true,
id: nanoid(),
label: 'core:menu.Monsters',
label: 'core:menu.monsters',
element: <MonstersPage />,
children: [
{
path: '',
showInMenu: false,
id: nanoid(),
label: 'core:menu.Session',
label: 'core:menu.session',
element: <MonstersPage />,
},
{
path: ':section',
showInMenu: false,
id: nanoid(),
label: 'core:menu.Session',
label: 'core:menu.session',
element: <MonstersPage />,
children: [
{
path: ':monster',
showInMenu: false,
id: nanoid(),
label: 'core:menu.npcs.NPCs',
label: 'core:menu.npcs.npcs',
element: <MonstersPage />,
},
],
Expand All @@ -87,7 +87,7 @@ export const menuRoutes: MenuRoute[] = [
{
path: 'calendar',
id: nanoid(),
label: 'core:menu.Calendar',
label: 'core:menu.calendar',
element: <CalendarPage />,
},
// {
Expand All @@ -98,66 +98,73 @@ export const menuRoutes: MenuRoute[] = [
{
path: 'places',
id: nanoid(),
label: 'core:menu.places.Places',
label: 'core:menu.places.places',
children: [
{
path: 'village',
id: nanoid(),
label: 'core:menu.places.Village',
label: 'core:menu.places.village',
element: <VillagePage />,
},
{
path: 'map',
id: nanoid(),
label: 'core:menu.places.Map',
label: 'core:menu.places.map',
element: <MapPage />,
},
],
},
{
path: 'gear',
id: nanoid(),
label: 'core:menu.gear.Gear',
label: 'core:menu.gear.gear',
children: [
{
path: 'tables',
id: nanoid(),
label: 'core:menu.gear.Tables',
label: 'core:menu.gear.tables',
element: <GearPage />,
},
{
path: 'finds',
id: nanoid(),
label: 'core:menu.gear.Finds',
label: 'core:menu.gear.finds',
element: <FindsPage />,
},
],
},
{
path: 'npcs',
id: nanoid(),
label: 'core:menu.npcs.NPCs',
label: 'core:menu.npcs.npcs',
children: [
{
path: 'names',
id: nanoid(),
label: 'core:menu.npcs.Names',
label: 'core:menu.npcs.names',
element: <NameGeneratorPage />,
},
{
path: 'typical',
id: nanoid(),
label: 'core:menu.npcs.Typical',
label: 'core:menu.npcs.typical',
element: <TypicalKinPage />,
},
{
path: 'npc',
id: nanoid(),
label: 'core:menu.npcs.Npc',
label: 'core:menu.npcs.npc',
element: <NpcPage />,
},
],
},
{
path: '*',
label: 'core:menu.monsters',
id: nanoid(),
element: <HomePage />,
showInMenu: false,
},
]

const createAppRouteRecurisvely = (menuRoutes: MenuRoute[]): RouteObject[] => {
Expand Down Expand Up @@ -198,7 +205,7 @@ export const Menu = ({ menuRoutes, close }: MenuProps) => {
return (
<>
{menuRoutes
.filter((mr) => mr.path !== '' || mr.showInMenu !== false)
.filter((mr) => mr.path !== '' && mr.showInMenu !== false)
.map((route) => {
if (
route.children &&
Expand Down
4 changes: 2 additions & 2 deletions src/components/Name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const Name = ({ name }: NameProps) => {
{name[currentLang].firstName}
{name[currentLang]?.familyName && ` ${name[currentLang].familyName}`}
{name[currentLang]?.homeName &&
` ${t('names:OF')} ${name[currentLang].homeName}`}
` ${t('names:of')} ${name[currentLang].homeName}`}
{name[currentLang]?.nickName &&
` ${t('names:THE')} ${name[currentLang].nickName}`}
` ${t('names:the')} ${name[currentLang].nickName}`}
</div>
)
}
1 change: 1 addition & 0 deletions src/components/ParchmentButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const ParchmentButton = (props: ParchmentButtonProps) => {
group min-w-fit
${isDisabled ? 'cursor-not-allowed' : 'cursor-pointer'}
${props.fullWidth ? 'w-full' : 'w-fit'}
focus:outline-none
`}
>
Expand Down
14 changes: 7 additions & 7 deletions src/components/calendar-day-names.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@ export const CalendarDayNames = () => {
return (
<>
<DayName isCurrentDate={currentDate.dayIndex === 0}>
{t('calendar:SunDay')}
{t('calendar:sun_day')}
</DayName>
<DayName isCurrentDate={currentDate.dayIndex === 1}>
{t('calendar:MoonDay')}
{t('calendar:moon_day')}
</DayName>
<DayName isCurrentDate={currentDate.dayIndex === 2}>
{t('calendar:BloodDay')}
{t('calendar:blood_day')}
</DayName>
<DayName isCurrentDate={currentDate.dayIndex === 3}>
{t('calendar:EarthDay')}
{t('calendar:earth_day')}
</DayName>
<DayName isCurrentDate={currentDate.dayIndex === 4}>
{t('calendar:GrowthDay')}
{t('calendar:growth_day')}
</DayName>
<DayName isCurrentDate={currentDate.dayIndex === 5}>
{t('calendar:HarvestDay')}
{t('calendar:harvest_day')}
</DayName>
<DayName isCurrentDate={currentDate.dayIndex === 6}>
{t('calendar:StillDay')}
{t('calendar:still_day')}
</DayName>
</>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/calendar-day.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const CalendarDayDisplay = ({ day }: CalendarDayProps) => {
<div className="flex gap-2">
<div>{getMoonEmoji(day.moon)}</div>
<div>
{day.moon === 'new' && t('calendar:NewMoon')}
{day.moon === 'full' && t('calendar:FullMoon')}
{day.moon === 'new' && t('calendar:new_moon')}
{day.moon === 'full' && t('calendar:fullMoon')}
</div>
</div>
)}
Expand Down
7 changes: 3 additions & 4 deletions src/components/encounter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { allEncounters } from '../data/encounter.data'
import { EncounterViewModel } from '../models/encounter.model'
import { terrainTranslationDict } from '../models/terrain.model'
import { useAppSelector } from '../store/store.hooks'
import {
selectCurrentLanguage,
Expand Down Expand Up @@ -31,14 +32,12 @@ export const Encounter = ({ encounter }: EncounterProps) => {
</div>
<div>
<>
{t('common:Page')}. {encounter.page}
{t('common:page')}. {encounter.page}
</>
</div>
<Stack.Horizontal spacing="small" wrap>
{encounter.possibleTerrains.map((pt) => (
<Tag key={pt}>
<>{t(`common:Terrain.${pt}`)}</>
</Tag>
<Tag key={pt}>{t(terrainTranslationDict[pt])}</Tag>
))}
</Stack.Horizontal>
</Stack.Vertical>
Expand Down
2 changes: 1 addition & 1 deletion src/components/month-collapse-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const MonthCollapseButton = ({
return (
<button
aria-label={
t(collapsed ? `calendar:ShowMonth` : `calendar:HideMonth`) ?? ''
t(collapsed ? `calendar:show_month` : `calendar:hide_month`) ?? ''
}
className={`
group flex w-full items-center gap-2 text-left
Expand Down
18 changes: 9 additions & 9 deletions src/data/encounter.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ValidLanguage } from '../hooks/useValidLanguage'
import { EncounterData, TerrainEncounterMap } from '../models/encounter.model'

export const encounterTable: TerrainEncounterMap = {
Plains: {
plains: {
41: 1,
42: 16,
43: 2,
Expand All @@ -22,7 +22,7 @@ export const encounterTable: TerrainEncounterMap = {
65: 15,
66: 30,
},
Forest: {
forest: {
41: 1,
42: 16,
43: 17,
Expand All @@ -42,7 +42,7 @@ export const encounterTable: TerrainEncounterMap = {
65: 13,
66: 26,
},
DarkForest: {
darkForest: {
41: 1,
42: 1,
43: 18,
Expand All @@ -62,7 +62,7 @@ export const encounterTable: TerrainEncounterMap = {
65: 27,
66: 30,
},
Hills: {
hills: {
41: 1,
42: 2,
43: 31,
Expand All @@ -82,7 +82,7 @@ export const encounterTable: TerrainEncounterMap = {
65: 13,
66: 14,
},
Mountain: {
mountain: {
41: 1,
42: 35,
43: 31,
Expand All @@ -102,7 +102,7 @@ export const encounterTable: TerrainEncounterMap = {
65: 13,
66: 37,
},
Lake: {
lake: {
41: 0,
42: 0,
43: 1,
Expand All @@ -122,7 +122,7 @@ export const encounterTable: TerrainEncounterMap = {
65: 41,
66: 41,
},
Swamp: {
swamp: {
41: 1,
42: 5,
43: 9,
Expand All @@ -142,7 +142,7 @@ export const encounterTable: TerrainEncounterMap = {
65: 42,
66: 42,
},
Mire: {
mire: {
41: 1,
42: 4,
43: 5,
Expand All @@ -162,7 +162,7 @@ export const encounterTable: TerrainEncounterMap = {
65: 34,
66: 42,
},
RuinCity: {
ruinCity: {
41: 1,
42: 4,
43: 5,
Expand Down
Loading

0 comments on commit 49bee09

Please sign in to comment.