import { tag, type Locale } from "./lib/language" import { dict as ar } from "./i18n/ar" import { dict as br } from "./i18n/br" import { dict as da } from "./i18n/da" import { dict as de } from "./i18n/de" import { dict as es } from "./i18n/es" import { dict as fr } from "./i18n/fr" import { dict as it } from "./i18n/it" import { dict as ja } from "./i18n/ja" import { dict as ko } from "./i18n/ko" import { dict as no } from "./i18n/no" import { dict as pl } from "./i18n/pl" import { dict as ru } from "./i18n/ru" import { dict as th } from "./i18n/th" import { dict as tr } from "./i18n/tr" import { dict as uk } from "./i18n/uk" import { dict as zh } from "./i18n/zh" import { dict as zht } from "./i18n/zht" const en = { "app.title": "AI Model Usage Rankings | OpenCode Data", "app.description": "Explore OpenCode usage across AI models, including token volume, rankings, market share, token pricing, session cost, cache ratio, and geo breakdowns.", "app.unfurlAlt": "OpenCode Data wordmark on a dark patterned background", "nav.dataHome": "Data Home", "nav.topModels": "Top Models", "nav.leaderboard": "Leaderboard", "nav.uniqueUsers": "Unique Users", "nav.sessionCost": "Session Cost", "nav.tokenCost": "Token Cost", "nav.cacheRatio": "Cache Ratio", "nav.marketShare": "Market Share", "nav.geoBreakdown": "Geo Breakdown", "nav.overview": "Overview", "nav.usage": "Usage", "nav.users": "Users", "nav.efficiency": "Efficiency", "nav.peers": "Peers", "nav.models": "Models", "header.brandLabel": "Data home", "header.sectionNavLabel": "Data sections", "header.githubAria": "Star OpenCode on GitHub", "header.github": "GitHub", "header.tryOpenCode": "Try OpenCode", // The header button's label on phones: the same where it fits beside the 20px product name at 375px, else a short // "Try now". "header.tryOpenCodeShort": "Try OpenCode", "header.openNav": "Open navigation", "header.closeNav": "Close navigation", "theme.groupLabel": "Theme", "theme.dark": "Dark", "theme.light": "Light", "theme.system": "System", "footer.modelData": "Model Data", "footer.legal": "Legal", "footer.connect": "Connect", "footer.language": "Language", "footer.terms": "Terms of service", "footer.privacy": "Privacy policy", "footer.contact": "Contact us", "footer.community": "Community", "footer.youtube": "YouTube", "footer.homeAria": "OpenCode Home", "footer.status.operational": "All systems operational", "footer.status.degraded": "Degraded performance", "footer.status.outage": "Service disruption", "footer.status.unknown": "System status", "footer.copyright": "© 2026 Anomaly Innovations Inc.", "bridge.learnMore": "LEARN MORE", "product.allUsers": "All Users", "product.zen": "Models", "product.go": "Go", "range.1D": "1 Day", "range.1W": "1 Week", "range.2W": "2 Weeks", "range.1M": "1 Month", "range.2M": "2 Months", "chart.weekly": "7 Days", "chart.daily": "Yesterday", "chart.period.daily": "Daily", "chart.period.weekly": "Weekly", "chart.input": "Input", "chart.output": "Output", "chart.cached": "Cached", "chart.uncached": "Uncached", "chart.ratio": "Ratio", "chart.model": "Model", "chart.cacheRatio": "Cache Ratio", "chart.costSession": "Cost/Session", "chart.tokensSession": "Tokens/Session", "chart.costPerSession": "COST / SESSION", "chart.tokensPerSession": "TOKENS / SESSION", "chart.live": "Live", "chart.percent": "percent", "chart.leaderboardAria": "Model token leaderboard", "chart.scrollableLeaderboardAria": "Scrollable model token leaderboard", "chart.byAuthor": "by {{author}}", "chart.vsPreviousWeek": "vs previous week", "chart.date": "Date", "home.updated": "Updated", "home.noRows": "No rows yet", "home.justNow": "just now", "home.heroCopy": "See which models are winning real usage, how the mix is shifting, and what that means for cost.", "home.summary": "As of {{date}}, {{first}} led OpenCode usage over the past 7 days with {{firstTokens}} tokens, followed by {{second}} ({{secondTokens}}) and {{third}} ({{thirdTokens}}).", "home.loadingTitle": "Loading data", "home.loadingDescription": "Reading model aggregates.", "home.usageTitle": "Usage", "home.topModelsDescription": "Usage of models across OpenCode.", "home.noUsageTitle": "No usage data", "home.noUsageDescription": "No model rows matched this product and range.", "home.noLeaderboardTitle": "No leaderboard data", "home.noLeaderboardDescription": "No model rows matched this product and range.", "home.productFilter": "Product filter", "home.dateRange": "Date range", "home.stackedUsageChart": "Stacked top model usage chart", "home.total": "total", "home.modelUsers": "model users", "home.new": "New", "home.uniqueUsersTitle": "Unique Users", "home.uniqueUsersDescription": "OpenCode users by model.", "home.noUserDataTitle": "No user data", "home.noUserDataDescription": "No user-bearing model rows matched this window.", "home.uniqueUsersChart": "Stacked unique user chart by model", "home.marketShareTitle": "Market Share", "home.marketShareDescription": "Compare token share by model author.", "home.noMarketTitle": "No market data", "home.noMarketDescription": "No model rows matched this range.", "home.marketChart": "Market share by model author", "home.noData": "No data", "home.geoTitle": "Geographic Breakdown", "home.noGeoTitle": "No geo data", "home.noGeoDescription": "No geo rows matched this range.", "home.unknown": "Unknown", "home.tokenCostTitle": "Token Cost", "home.tokenCostDescription": "Price per 1M tokens.", "home.noTokenCostTitle": "No token cost data", "home.noTokenCostDescription": "No cost-bearing model rows matched this product.", "home.cacheRatioTitle": "Cache Ratio", "home.cacheRatioDescription": "Share of input tokens served from cache.", "home.noCacheTitle": "No cache ratio data", "home.noCacheDescription": "No input-token model rows matched this product.", "home.sessionCostTitle": "Session Cost", "home.sessionCostDescription": "Average cost per session.", "home.noSessionCostTitle": "No session cost data", "home.noSessionCostDescription": "No session-bearing model rows matched this product.", "home.costSession": "Cost/Session", "home.newModelsTitle": "New Models", "home.newModelsDescription": "The biggest launch of the past 30 days.", "home.retentionDescription": "Weekly users returning the next week.", "home.noRetentionTitle": "No retention data", "home.noRetentionDescription": "Retention appears after a complete return week is available.", "home.comparisonsTitle": "Model Comparisons", "home.comparisonsDescription": "Popular model pairs from the leaderboard.", "table.rank": "Rank", "newModels.releasedBy": "{{author}}, released {{date}}", "newModels.released": "Released {{date}}", "newModels.free": "Free on OpenCode", "newModels.tokensSinceLaunch": "tokens since launch", "newModels.usersTried": "users tried it", "newModels.alsoNew": "Also new", "newModels.dailyUsage": "{{model}} daily usage", "retention.marker": "Retention", "retention.rate": "Rate", "retention.eligible": "Eligible", "retention.aria": "{{model}}, {{rate}} weekly retention, {{users}} eligible user-weeks", "compare.detail.topTwo": "Top two by recent usage", "compare.detail.leaderChallenger": "Leader vs challenger", "compare.detail.adjacent": "Adjacent leaderboard pair", "compare.detail.topAlternative": "Top model alternative", "lab.title": "{{lab}} AI Model Usage & Rankings | OpenCode Data", "lab.description": "Compare {{lab}} models used in OpenCode, including token usage, model rankings, context windows, release dates, costs, and model-specific data.", "lab.summary": "{{lab}} models processed {{tokens}} tokens across OpenCode over the past two months, {{share}} of all usage. {{model}} was the most-used {{lab}} model.", "lab.loadingTitle": "Model Lab", "lab.loadingDescription": "Reading model availability and recent OpenCode usage.", "lab.notFound": "No models matched this lab.", "lab.heroPrefix": "Explore {{count}} {{lab}} models used in OpenCode", "lab.heroIncluding": "including {{models}}", "lab.heroSuffix": "Compare recent token usage, context windows, release dates, and model data.", "lab.tokensProcessed": "Tokens Processed", "lab.pending": "Pending", "lab.usageAfterActivity": "Usage appears after model activity lands", "lab.latestRelease": "Latest release {{date}}", "lab.shareOfUsage": "{{share}} of recent OpenCode usage", "lab.usageTitle": "{{lab}} token usage", "lab.usageDescription": "Token volume and unique users.", "lab.noUsageTitle": "No usage yet", "lab.noUsageDescription": "Recent token usage appears here once this lab has activity.", "lab.dailyTokenChart": "{{lab}} token usage chart", "lab.dailyTokens": "Tokens", "lab.tokens": "tokens", "lab.modelsTitle": "{{lab}} models", "lab.modelsDescription": "Catalog details plus recent usage.", "lab.recentUsageAndLimits": "Recent usage and limits.", "lab.usage": "Usage", "lab.share": "Share", "model.title": "{{model}} Usage, Cost & Rank | OpenCode Data", "model.description": "View {{model}} OpenCode usage data, including token volume, weekly rank, token mix, costs, cache ratio, sessions, geo breakdowns, and peer models.", "model.summary": "{{model}} ranked #{{rank}} by tokens across OpenCode last week, with {{share}} of tokens over the past two months.", "model.summaryUnranked": "{{model}} had {{share}} of tokens across OpenCode over the past two months.", "model.summaryPrice": "{{model}} costs {{input}} per 1M input tokens and {{output}} per 1M output tokens.", "model.loadingTitle": "Model Data", "model.loadingDescription": "Reading model aggregates.", "model.loadingProfile": "Reading the model profile.", "model.noDataTitle": "No model data", "model.noDataDescription": "Try opening a model from the leaderboard.", "model.noMatched": "No model facts or usage rows matched {{id}}.", "model.fallback": "Model", "model.catalogFallback": "Model facts from the shared model index. OpenCode usage appears once this model has activity.", "model.unranked": "Unranked across last week's OpenCode usage", "model.ranked": "Ranked #{{rank}} across last week's OpenCode usage", "model.observedVolume": "with {{share}} of observed 2M volume.", "model.weights": "Model weights: {{label}}", "model.rank": "7D Rank", "model.profile": "Model Profile", "model.listed": "Listed", "model.noCurrentUsage": "No OpenCode usage in the current data window.", "model.facts": "Model facts", "model.context": "Context", "model.output": "Output", "model.knowledge": "Knowledge", "model.release": "Release", "model.inputs": "Inputs", "model.overviewDescription": "Recent tokens, unique users, and market position.", "model.noSummaryTitle": "No usage summary", "model.noSummaryDescription": "This model has no OpenCode usage rows yet.", "model.tokens": "Tokens", "model.uniqueUsers": "Unique Users", "model.lastTwoMonths": "last two months", "model.sessions": "Sessions", "model.completedSessions": "completed sessions", "model.tokenShare": "Token Share", "model.totalModels": "{{count}} models", "model.momentum": "Momentum", "model.vsPreviousWindow": "vs previous window", "model.usageDescription": "Token volume.", "model.noUsageTitle": "No usage", "model.noUsageDescription": "No usage landed in the current window.", "model.dailyTokenChart": "Token usage chart", "model.usersDescription": "People using this model.", "model.noUsersTitle": "No user data", "model.noUsersDescription": "No user-bearing rows landed in the current window.", "model.dailyUserChart": "Unique user chart", "model.efficiencyDescription": "Cost, cache behavior, and average session shape.", "model.noEfficiencyTitle": "No efficiency data", "model.noEfficiencyDescription": "Efficiency data appears after usage lands.", "model.totalSpendLabel": "Total spend", "model.cost": "Cost", "model.totalSpend": "total spend", "model.costPerMillion": "Cost / 1M", "model.costInput": "Cost input", "model.costOutput": "Cost output", "model.inputOutput": "input / output", "model.observedTokens": "observed all tokens", "model.costSession": "Cost / Session", "model.averageCostSession": "Average cost / Session", "model.average": "average", "model.tokensSession": "Tokens / Session", "model.averageTokensSession": "Average tokens / session", "model.cacheRatio": "Cache Ratio", "model.inputTokens": "input tokens", "model.noGeoTitle": "No geo data", "model.noGeoDescription": "No OpenCode geo rows matched this model.", "model.peersDescription": "Nearby models by recent OpenCode token volume.", "model.noPeersTitle": "No peers", "model.noPeersDescription": "Peer rankings appear after usage lands.", "model.noUsageLastWeek": "No usage last week", "model.newThisWeek": "New this week", "model.sameAsPreviousWeek": "Same as previous week", "model.vsPreviousWeek": "{{change}} vs previous week", "model.pdf": "PDF", "format.users": "users", "format.tokens": "tokens", "methodology.title": "Methodology", "methodology.description": "How this data is collected.", "methodology.updatesLabel": "Updates", "methodology.updates": "Aggregated every hour. Days and weeks use UTC.", "methodology.tokensLabel": "Tokens", "methodology.tokens": "Input, output, reasoning, and cached tokens for each request.", "methodology.usersLabel": "Users and sessions", "methodology.users": "Approximate counts of distinct users and OpenCode sessions.", "methodology.costLabel": "Cost", "methodology.cost": "Session cost is the average cost per OpenCode session. Token prices are list prices from the OpenCode model catalog.", "methodology.retentionLabel": "Retention", "methodology.retention": "The share of a model's users in one week who use it again the next week.", "methodology.benchmarksLabel": "Benchmarks", "methodology.benchmarks": "Published scores from the models.dev catalog, matched to a single benchmark version per view.", "methodology.citeLabel": "Citation", "methodology.cite": "Cite OpenCode Data (opencode.ai/data) with the update time shown at the top of the page.", // The share cards (share/sections.ts, share/card.ts), drawn on a canvas 1080px wide or more: headlines wrap to at // most four lines, eyebrows, captions and labels keep to one. A word after {{count|...}} agrees with the count. "share.title.retention": "Weekly Retention", "share.title.comparison": "Model Comparison", "share.range.past7Days": "Past 7 days", "share.range.yesterday": "Yesterday", "share.range.pastDays": "Past {{count}} {{count|one:day|other:days}}", "share.range.pastWeeks": "Past {{count}} {{count|one:week|other:weeks}}", "share.range.past2Months": "Past 2 months", "share.range.weekOf": "Week of {{date}}", "share.range.weekOverWeek": "Week over week", "share.range.perSession": "Average per session", "share.range.outputPrice": "USD per 1M output tokens", "share.range.inputShare": "Share of input tokens", // {{when}} in the headlines and captions below. "share.when.past7Days": "in the past 7 days", "share.when.yesterday": "yesterday", "share.when.pastDays": "in the past {{count}} {{count|one:day|other:days}}", "share.when.pastWeeks": "in the past {{count}} {{count|one:week|other:weeks}}", "share.when.day": "on {{date}}", "share.when.week": "in the week of {{date}}", // The line under a chart: {{label}} is All models or All labs. "share.total.allModels": "All models", "share.total.allLabs": "All labs", "share.total.date": "{{label}}, {{date}}", "share.total.pastDays": "{{label}}, past {{count}} {{count|one:day|other:days}}", "share.total.pastWeeks": "{{label}}, past {{count}} {{count|one:week|other:weeks}}", "share.other": "Other", "share.new": "New", // Each card's headline, then the caption under its big number, which starts with a capital on the card. "share.led.headline": "{{name}} led OpenCode usage {{when}}, with {{value}} tokens", "share.led.stat": "tokens for {{name}}, {{when}}", "share.total.headline": "OpenCode handled {{value}} tokens {{when}}", "share.total.stat": "tokens on OpenCode, {{when}}", "share.users.headline": "{{name}} had the most OpenCode users {{when}}, with {{value}}", "share.users.stat": "OpenCode users on {{name}}, {{when}}", "share.retention.headline": "{{name}} kept {{rate}} of its OpenCode users from one week to the next", "share.retention.stat": "of {{name}} users came back the next week", "share.sessionCost.headline": "An OpenCode session with {{name}} costs {{cost}} on average", "share.sessionCost.stat": "average cost of an OpenCode session with {{name}}", "share.tokenCost.headline": "{{name}} has the lowest output price on OpenCode, at {{price}} per 1M tokens", "share.tokenCost.stat": "per 1M output tokens for {{name}}", "share.cache.headline": "{{name}} served {{ratio}} of its input tokens from cache", "share.cache.stat": "of {{name}} input tokens came from cache", "share.market.headline": "{{lab}} served {{share}} of OpenCode tokens {{when}}", "share.market.stat": "of OpenCode tokens went to {{lab}} models, {{when}}", "share.geo.headline": "{{country}} sent the most OpenCode tokens in the past 2 months, {{share}} of the total", "share.geo.stat": "of OpenCode tokens came from {{country}}", // {{ratio}} is a multiple such as 4.2x. "share.comparison.headline": "{{first}} served {{ratio}} the tokens of {{second}} on OpenCode in the past 7 days", "share.comparison.stat": "the tokens of {{second}}, for {{first}}", // The comparison's measures, set in capitals round the radar: keep them short. "share.comparison.tokens": "Tokens, past 7 days", "share.comparison.dailyUsers": "Daily users", "share.comparison.retention": "Weekly retention", "share.comparison.sessionCost": "Cost per session", "share.comparison.outputPrice": "Output, per 1M tokens", "share.comparison.cache": "Input from cache", // The closing slide's line, very large: two short lines. "share.card.outro": "The largest inference\nin the world", "share.card.tokens": "Tokens", "share.card.versus": "vs", "share.card.updated": "Updated {{date}}", "share.embed.missing": "This embed doesn't exist.", "share.embed.open": "{{title}} on OpenCode Data", // The share editor (share/share.tsx). The bar's labels and tooltips are a word or two; its buttons hold the // option's name beside an icon in a narrow, fixed width. "share.open": "Share", "share.openSection": "Share {{title}}", "share.close": "Close", "share.settings": "Settings", "share.customize": "Customize", "share.done": "Done", // A dropdown's accessible name: the setting, then its value. "share.option": "{{label}}: {{value}}", "share.type": "Type", "share.type.video": "Video", "share.type.image": "Image", "share.type.embed": "Embed", "share.date": "Date", "share.lead": "Lead with", "share.lead.top": "Top model", "share.lead.total": "Total", "share.chart": "Chart", "share.chart.bars": "Bars", "share.chart.race": "Race", "share.chart.list": "List", "share.chart.dots": "Dots", "share.layout": "Layout", "share.layout.headline": "Headline", "share.layout.number": "Number", "share.layout.title": "Title", // Sizes for where the card goes: a feed post, a square post, a story, a wide (landscape) post. "share.size": "Size", "share.size.feed": "Feed", "share.size.square": "Square", "share.size.story": "Story", "share.size.wide": "Wide", "share.style": "Style", "share.style.dark": "Dark", "share.style.light": "Light", // The style that colours the card in the winner's colour. "share.style.top": "Top", // An embed shows the latest data, or keeps the numbers it was made with. "share.data": "Data", "share.data.live": "Live data", "share.data.fixed": "Fixed data", "share.music": "Music", "share.music.none": "No music", "share.music.mute": "Mute music", "share.mute": "Mute", "share.unmute": "Unmute", "share.shuffle": "Shuffle", // A track with explicit lyrics: the badge, its one-letter form where the name would be cut off, and its tooltip. "share.explicit": "Explicit", "share.explicit.short": "E", "share.explicit.title": "Explicit lyrics", "share.export": "Save", "share.export.image": "Save image", "share.export.video": "Save video", "share.export.cancel": "Cancel saving", "share.cancel": "Cancel", "share.copied": "Copied", "share.copyEmbed": "Copy embed code", "share.position": "Video position", "share.previous": "Previous", "share.next": "Next", "share.saved.image": "PNG saved", "share.saved.video": "Video saved", "share.error.generic": "Something went wrong", "share.error.copy": "Couldn't copy the embed code", "share.error.empty": "Nothing to share", "share.error.canvas": "Canvas is not available", "share.error.image": "Could not make the image", "share.error.video": "This browser can't record video", "share.calendar.label": "Choose a date", "share.calendar.previous": "Previous month", "share.calendar.next": "Next month", "share.calendar.wholeRange": "Whole range", } as const export type Key = keyof typeof en export type Dict = Record const dictionaries = { ar, br, da, de, en, es, fr, it, ja, ko, no, pl, ru, th, tr, uk, zh, zht, } satisfies Record export function dict(locale: Locale) { return dictionaries[locale] } export function translate(locale: Locale, key: Key, params?: Record) { const text = dictionaries[locale][key] if (!params) return text return ( text // A word that agrees with a count, in the forms the locale's plural rules ask for, other being the fallback: // {{count|one:day|other:days}}. .replace(/\{\{(\w+)\|([^}]*)\}\}/g, (raw, key: string, forms: string) => { const value = params[key] if (typeof value !== "number") return raw const choices = new Map( forms.split("|").map((form) => [form.slice(0, form.indexOf(":")), form.slice(form.indexOf(":") + 1)]), ) return choices.get(new Intl.PluralRules(tag(locale)).select(value)) ?? choices.get("other") ?? raw }) .replace(/\{\{(\w+)\}\}/g, (raw, key) => { const value = params[key] if (value === undefined || value === null) return raw return String(value) }) ) }