Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Countries also have the option to customize Inji as per their requirements. Refe

The following customizations are available in Inji:

* [Workflow Customization](https://docs.mosip.io/inji/customization-overview/workflow-customization)
* [UI Customization](https://docs.mosip.io/inji/customization-overview/ui-customization)
* [Locale Customization](https://docs.mosip.io/inji/customization-overview/locale-customization)
* [Configuration](https://docs.mosip.io/inji/customization-overview/configuration)
* [Credential Provider](https://docs.mosip.io/inji/customization-overview/credential_providers)
* [Workflow Customization](workflow-customization.md)
* [UI Customization](ui-customization.md)
* [Locale Customization](locale-customization.md)
* [Configuration](configuration.md)
* [Credential Provider](credential_providers.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,70 @@

## Configuration for Inji Wallet

The configurable properties for Inji Wallet can be found at [inji-default.properties](https://github.com/mosip/inji-config/blob/master/inji-default.properties). This property file is maintained as one for each deployment environment. On [this](https://github.com/mosip/inji-config) repository, each environment configuration is placed in a corresponding branch specific to that environment.
The configurable properties for Inji Wallet can be found at [inji-default.properties](https://github.com/inji/inji-config/blob/master/inji-default.properties). This property file is maintained as one for each deployment environment. On [this](https://github.com/inji/inji-config) repository, each environment configuration is placed in a corresponding branch specific to that environment.

> Refer to [inji-default.properties](https://github.com/mosip/inji-config/blob/collab/inji-default.properties) of Collab environment.
> Refer to [inji-default.properties](https://github.com/inji/inji-config/blob/collab/inji-default.properties) of Collab environment.

These values will be used by Inji Wallet via Mimoto. Mimoto loads all the configurations and exposes an API which is used by the Inji Wallet application to fetch and store the configurations in the local storage.

API used to fetch these configurations: `https://api.collab.mosip.net/v1/mimoto/allProperties`
API used to fetch these configurations:

```http
GET /v1/mimoto/allProperties
```

For example, in the Collab environment:

```text
https://api.collab.mosip.net/v1/mimoto/allProperties
```

The implementers can choose to use the existing configurations or add new configurations to them.

The properties used by Inji Wallet are:
## Properties Used by Mobile

| Property | Default | Purpose |
| --- | --- | --- |
| `mosip.inji.allowedAuthType` | `demo,otp,bio-Finger,bio-Iris,bio-Face` | Allowed auth types for IDA-based flows. |
| `mosip.inji.allowedEkycAuthType` | `demo,otp,bio-Finger,bio-Iris,bio-Face` | Allowed eKYC auth types. |
| `mosip.inji.allowedInternalAuthType` | `otp,bio-Finger,bio-Iris,bio-Face` | Allowed internal auth types. |
| `mosip.inji.faceSdkModelUrl` | `https://${mosip.api.public.host}/inji` | Base path for downloading face SDK model assets. |
| `mosip.inji.modelDownloadMaxRetry` | `10` | Maximum retry count for face model download. |
| `mosip.inji.vcDownloadMaxRetry` | `10` | Maximum retry count while polling/downloading credentials. |
| `mosip.inji.vcDownloadPoolInterval` | `6000` | Poll interval, in milliseconds, for VC download status checks. |
| `mosip.inji.audience` | `ida-binding` | Audience value used in wallet binding/token flows. |
| `mosip.inji.issuer` | `residentapp` | Issuer value used in wallet binding/token flows. |
| `mosip.inji.warningDomainName` | `https://${mosip.api.public.host}` | Domain shown/used by warning screens and request handling. |
| `mosip.inji.openId4VCIDownloadVCTimeout` | `30000` | Timeout, in milliseconds, for OpenID4VCI credential download calls. |
| `mosip.inji.aboutInjiUrl` | Environment-specific docs URL | URL opened from the About Inji Wallet screen. |
| `mosip.inji.minStorageRequiredForAuditEntry` | `2` | Minimum free storage, in MB, before audit entries are written. |
| `mosip.inji.minStorageRequired` | `2` | Minimum free storage, in MB, before downloaded or received VCs are stored. |
| `mosip.inji.openid4vpClientValidation` | `true` | Enables pre-registered verifier validation in OpenID4VP sharing. |

## Related Mimoto Configuration

Several wallet behaviors are configured in [`mimoto-default.properties`](https://github.com/inji/inji-config/blob/master/mimoto-default.properties), not `inji-default.properties`. Common examples:

| Property | Purpose |
| --- | --- |
| `mosip.openid.issuers` | File name for issuer configuration, usually `mimoto-issuers-config.json`. |
| `mosip.openid.verifiers` | File name for trusted verifier configuration, usually `mimoto-trusted-verifiers.json`. |
| `mosip.inji.web.url` and `mosip.inji.web.redirect.url` | Inji Web URL and redirect URL used by OVP flows. |
| `mosip.inji.qr.data.size.limit`, `mosip.inji.qr.code.height`, `mosip.inji.qr.code.width` | QR generation limits and size defaults. |
| `mosip.inji.ovp.qrdata.pattern`, `mosip.inji.ovp.redirect.url.pattern`, `mosip.inji.ovp.error.redirect.url.pattern` | OpenID4VP QR and redirect URL templates. |
| `wallet.passcode.*` | Wallet passcode retry and lock behavior. |
| `cache.*.expiry-time-in-min` | Cache expiry for issuer config and well-known responses. |

## App Build-Time Configuration

Some customization is build-time configuration in the mobile app, not server-side configuration:

| Variable | Used by | Purpose |
| --- | --- | --- |
| `MIMOTO_HOST` | `shared/constants.ts` | Base URL used by wallet API calls to Mimoto. |
| `ESIGNET_HOST` | `shared/constants.ts` | Base URL used by linked authorization calls. |
| `APPLICATION_THEME` | `components/ui/styleUtils.ts`, `app.config.ts`, `SplashScreen.tsx` | Selects default vs purple theme and adaptive splash image. |
| `LIVENESS_DETECTION` | `shared/constants.ts` | Enables/disables liveness detection checks. |
| `DEBUG_MODE` | `shared/constants.ts` | Enables debug behavior in the app. |

* `mosip.inji.faceSdkModelUrl(https://${mosip.api.public.host}/inji)`: This is the path of the file server from where the face SDK model can be downloaded.
* `mosip.inji.modelDownloadMaxRetry(10)`: The maximum times the application will try to fetch the model.
* `mosip.inji.audience(ida-binding)`: This is used to generate the JWT token which will be passed during online login.
* `mosip.inji.issuer(residentapp)`: This is used to generate the JWT token which will be passed during online login.
* `mosip.inji.warningDomainName(https://${mosip.api.public.host})`: This is the mimoto domain used to access all Apis.
* `mosip.inji.aboutInjiUrl(https://docs.inji.io/inji-wallet/inji-mobile)`: This is the url for Inji Wallet Mobile documentation used in About Inji Wallet page.
* `mosip.inji.minStorageRequiredForAuditEntry(2)`: This is threshold(minimum storage space required) in MB for storing audit entries.
* `mosip.inji.minStorageRequired(2)`: This is threshold(minimum storage space required) in MB for storing downloaded / received vc.
Keep deployment config, Mimoto config, and mobile build-time variables in sync. `MIMOTO_HOST` only sets the wallet's Mimoto base URL; issuer and token endpoints are configured on the Mimoto side, primarily through `mimoto-issuers-config.json`, and must be valid for the selected Mimoto deployment.
Original file line number Diff line number Diff line change
@@ -1,18 +1,76 @@
# Locale customization

## Steps to Support a new language
Inji Wallet Mobile uses `i18next`, `react-i18next`, and `expo-localization`. Locale resources live in the top-level `locales` folder in the mobile wallet repo, and `i18n.ts` wires those resources into the app.

* Under `locales` folder, localization of a particular language JSON file has to be added.
* Language JSON has to be imported in `i18n.ts` and load the resources to i18next as follows. `import fil from './locales/fil.json';` `const resources = { en, fil, ar, hi, kn, ta };`
* To ensure the language needs to be included in the const `SUPPORTED_LANGUAGES`.
* To use with react, must include the key with the 't' function
## Supported Languages

The mobile codebase currently imports these resource files:

| App code | Resource file | Language |
| --- | --- | --- |
| `en` | `locales/en.json` | English |
| `fil` | `locales/fil.json` | Filipino |
| `ar` | `locales/ara.json` | Arabic |
| `hi` | `locales/hin.json` | Hindi |
| `kn` | `locales/kan.json` | Kannada |
| `ta` | `locales/tam.json` | Tamil |

## Add a New Language

1. Add a JSON resource file under `locales`, using the same namespaces and keys as `locales/en.json`.
2. Import the file in `i18n.ts`.
3. Add the imported resource to the `resources` object.
4. Add the app language code and display label to `SUPPORTED_LANGUAGES`.

Example:

```ts
import fr from './locales/fra.json';

const resources = {en, fil, ar, hi, kn, ta, fr};

export const SUPPORTED_LANGUAGES = {
en: 'English',
fil: 'Filipino',
ar: 'Arabic',
hi: 'Hindi',
kn: 'Kannada',
ta: 'Tamil',
fr: 'French',
};
```

The display labels in `SUPPORTED_LANGUAGES` can be localized; keep the object keys aligned with the resource keys.

Use translations through `useTranslation` or the existing `i18n.t` helpers:

```tsx
const {t} = useTranslation('common');

<Text>{t('editLabel')}</Text>;
```
const { t } = useTranslation('common');
<Text>{t('editLabel')}</Text>

## Language Codes in Issuer Metadata

The wallet uses two-letter language codes internally, but issuer and credential metadata may use either two-letter or three-letter codes. `i18n.ts` builds a language-code map using the `iso-639-3` package so fields such as issuer display names and localized credential values can match either form.

When adding issuer display entries in `mimoto-issuers-config.json`, keep the `language` values consistent with the app language codes where possible:

```json
{
"display": [
{
"name": "Example Issuer",
"title": "Download Example Credential",
"description": "Download example credential",
"language": "en"
}
]
}
```

For OpenID4VCI well-known credential metadata, use the issuer's `locale` or localized claim metadata according to the OpenID4VCI specification. The wallet falls back to English, `en-US`, or the first available entry when a language-specific display entry is not found.

## About libraries

1. [i18next](https://www.i18next.com/)
Expand Down
Loading