-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[i18n-audio] Use 'audioID' naming instead of 'audioKey' (#3989)
- Loading branch information
Showing
13 changed files
with
89 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { z } from 'zod'; | ||
|
||
import { Dictionary } from './generic'; | ||
import { LanguageCode } from './language_code'; | ||
|
||
type AudioIdList = string[]; | ||
|
||
/** | ||
* Map of UI string key to a sequence of related speech audio clip IDs. | ||
* | ||
* Follows i18next JSON schema and supports one level of nesting. | ||
* See: https://www.i18next.com/misc/json-format | ||
*/ | ||
export type UiStringAudioIds = Dictionary< | ||
AudioIdList | Dictionary<AudioIdList> | ||
>; | ||
|
||
const AudioIdListSchema: z.ZodType<AudioIdList> = z.array(z.string()); | ||
|
||
/** | ||
* Map of UI string key to a sequence of related speech audio clip IDs. | ||
* | ||
* Follows i18next JSON schema and supports one level of nesting. | ||
* See: https://www.i18next.com/misc/json-format | ||
*/ | ||
export const UiStringAudioIdsSchema: z.ZodType<UiStringAudioIds> = z.record( | ||
z.union([AudioIdListSchema, z.record(AudioIdListSchema)]) | ||
); | ||
|
||
/** | ||
* Map of language code to {@link UiStringAudioIds}. | ||
*/ | ||
export type UiStringAudioIdsPackage = Partial< | ||
Record<LanguageCode, UiStringAudioIds> | ||
>; | ||
|
||
/** | ||
* Map of language code to {@link UiStringAudioIds}. | ||
*/ | ||
export const UiStringAudioIdsPackageSchema: z.ZodType<UiStringAudioIdsPackage> = | ||
z.record(z.nativeEnum(LanguageCode), UiStringAudioIdsSchema); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters