
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
@procore/ai-translations
Advanced tools
Library that provides a solution to use AI to translate text into a language
@procore/ai-translationsReact package for AI-powered UI string translation in frontend apps. It provides:
AITranslationProvider to initialize translation contextAITranslateText to render translated textuseAITranslation for direct access to translation and progress stateNeed deeper implementation details? See the internal guide: README.internal.md.
This package supports two runtime strategies:
frontend_translations: browser-based translation (Chrome-family AI APIs)backend_translations: server-side translation APIFor Procore-specific operational details, see README.internal.md.
yarn add @procore/ai-translations
Peer dependencies:
react >= 16 < 19react-dom >= 16 < 19@procore/web-sdk-mfe-utils > 1.0.0 < 2import React from 'react';
import {
AITranslationProvider,
AITranslateText,
} from '@procore/ai-translations';
export function AppRoot() {
return (
<AITranslationProvider
tool="timecard"
companyId={1}
projectId={10}
userId={42}
locale="es"
enableAIT={true}
companyLocale="de-DE"
projectLocale="fr-CA"
>
<AITranslateText text="Hello world" shouldTranslate={true} />
</AITranslationProvider>
);
}
AITranslationProviderRequired props:
locale: string - target locale (BCP-47, for example es, fr, de)tool: string - tool/MFE identifier used to scope translation eventscompanyId: numberprojectId: numberuserId: numberOptional props:
enableAIT?: boolean (default true) - when false, returns source text without translationcompanyLocale?: string - company-level locale from environment metadata (e.g. "de-DE"); passed through to context for downstream consumers such as AmplitudeprojectLocale?: string - project-level locale from environment metadata (e.g. "fr-CA"); passed through to context for downstream consumers such as AmplitudeAITranslateTextProps:
text: stringshouldTranslate: booleanshowHighlight?: boolean (default false)translatedIconProps?: TranslatedIconPropsuseAITranslation()Returns:
ait(text: string): Promise<string> - translates text or returns cached valuelocale: stringcompanyLocale: string | undefined - company-level locale from environment metadataprojectLocale: string | undefined - project-level locale from environment metadatatool: stringtranslationProgress: { progress: number; current: number; total: number } | nullmodelDownloadProgress: ModelDownloadProgress | nullrenderVersion: number | undefinedAI_TRANSLATION_FEATURE_FLAG_KEYgetAITranslationLDId(domain: string)flowchart LR
consumerApp[ConsumerApp] --> provider[AITranslationProvider]
provider --> aitCall["ait(text)"]
aitCall --> registryCheck[TranslationRegistryCheck]
registryCheck --> returnCached[ReturnCachedText]
registryCheck --> queueText[QueueText]
queueText --> manager[TranslationManager]
manager --> strategy[TranslatorStrategy]
strategy --> frontendClient[ChromeFrontendClient]
strategy --> backendClient[BackendApiClient]
frontendClient --> persist[PersistToIndexedDB]
backendClient --> persist
persist --> publish[PublishTranslationEvents]
publish --> rerender[AITranslateTextRerender]
rerender --> translatedUi[DisplayTranslatedText]
At runtime, strings are registered through ait(), processed in batches, cached in memory and IndexedDB, and then rerendered via package events.
The provider uses useConfig (React Query) to fetch translation config and refetch every 30 minutes.
Expected remote config shape:
type ToolConfig = {
strategy: 'frontend_translations' | 'backend_translations';
supportedLocales: string[];
translationBatchSize: number;
renderingBatchSize: number;
apiTimeout: number;
apiVersion: string;
};
AITranslateText and useAITranslation must be used inside AITranslationProvider.window.location.origin under /rest/.From packages/ai-translations:
yarn build
yarn test
yarn lint
yarn storybook
yarn cypress:run
FAQs
Library that provides a solution to use AI to translate text into a language
The npm package @procore/ai-translations receives a total of 6 weekly downloads. As such, @procore/ai-translations popularity was classified as not popular.
We found that @procore/ai-translations demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 303 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.