Skip to content

Instantly share code, notes, and snippets.

@Soviut
Created April 13, 2026 02:18
Show Gist options
  • Select an option

  • Save Soviut/d5db0fd45143fe329c6d6d1cf408d617 to your computer and use it in GitHub Desktop.

Select an option

Save Soviut/d5db0fd45143fe329c6d6d1cf408d617 to your computer and use it in GitHub Desktop.
Example i18n file using an organization structure I've found very useful
# This is an internationalization (i18n) organization structure I've developed
# and have used in multiple projects.
#
# A key aspect is the use of groups to categorize keys by use case. This
# keeps things organized and easy to maintain since everything has a place. It
# also helps maintain a nesting depth no deeper than 3 (eg: "pages.home.title").
#
# Available groups:
# meta, nav, models, actions, messages, forms, components, pages, enums
# META
# Branding and site meta data goes here
meta:
title: SiteTitle
# NAVIGATION
# top level site navigation
nav:
home: Home
music: Music
search: Search
login: Login
logout: Logout
# MODELS
# used in combination with "<action>Model" keys
# intended to dry up "create item", "create other", etc.
models:
item: item
items: items
user: user
users: users
plan: plan
plans: plans
# ACTIONS
# used for buttons, links and menu items
# note that "<action>Model" keys should be used with models keys
actions:
login: Sign In
logout: Sign Out
create: Create {{model}}
delete: Delete
# MESSAGES
# used for prompts, alerts and errors
messages:
noModel: There are currently no {{model}}
confirmDelete: Are you sure you want to delete this {{model}}?
userNotFound: User not found
invalidCredentials: Invalid email or password
# FORMS
# form labels should have no suffix (eg: "email")
# placeholders should have "<field>Placeholder" suffix
# help text should have "<field>Help" suffix
forms:
login:
email: Email
emailPlaceholder: Email
password: Password
passwordPlaceholder: Password
search:
term: Search
# COMPONENTS
# component-specific copy only
# make sure keys that belong in actions or messages do not go here!
components:
loading:
message: Loading...
lane:
instruction: Press right for next item. Press down for next category.
dialog:
title: Alert
# PAGES
# page-specific headings and copy only
# make sure keys that belong in actions or messages do not go here!
pages:
home:
title: Home
message: This message means i18n is working
instruction: Press down for content.
login:
title: Sign In
logout:
title: Sign Out
notFound:
title: Page Not Found
message: The page you are looking for does not exist.
# ENUMS
# enums and other data structures
enums:
activityStatus:
pending: Pending
active: Active
inactive: Inactive
currencies:
usd: USD
cad: CAD
frequencies:
month: Month
year: Year
plans:
premium: Premium
plus: Plus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment