@@ -220,14 +220,93 @@ Add your new language to the translations export file at `packages/i18n/src/tran
220220export {default as fr_FR } from ' ./fr-FR' ;
221221```
222222
223- ##### Test your translation
223+ #### Test your translation
224224
225225Build the package and test the new language in a sample application to ensure all translations are working correctly:
226226
227227``` bash
228228pnpm build --filter @asgardeo/i18n
229229```
230230
231+ To test your new language translation, you have two options:
232+
233+ ##### Option 1: Using ` npm ` symlinks
234+
235+ Create a symlink to test your local changes without publishing:
236+
237+ ``` bash
238+ # Navigate to the i18n package
239+ cd packages/i18n
240+
241+ # Create a global symlink
242+ npm link
243+
244+ # Navigate to your test application
245+ cd /path/to/your/test-app
246+
247+ # Link the local i18n package
248+ npm link @asgardeo/i18n
249+ ```
250+
251+ For more information about npm symlinks, see the [ npm link documentation] ( https://docs.npmjs.com/cli/v10/commands/npm-link ) .
252+
253+ ##### Option 2: Integrate into an existing sample
254+
255+ Use one of the existing sample applications in the [ ` samples/ ` ] ( ../samples/ ) directory:
256+
257+ ``` bash
258+ # Navigate to a sample app (e.g., teamspace-react)
259+ cd samples/teamspace-react
260+
261+ # Install dependencies
262+ pnpm install
263+
264+ # The sample will automatically use your local i18n package changes
265+ ```
266+
267+ ##### Testing with AsgardeoProvider
268+
269+ Once you have your testing environment set up (using either option above), configure the AsgardeoProvider to use your new language:
270+
271+ - ** Import your new language bundle**
272+
273+ ``` tsx
274+ import {fr_FR } from ' @asgardeo/i18n' ;
275+ ```
276+
277+ - ** Configure the AsgardeoProvider with the new language**
278+
279+ ``` tsx
280+ <AsgardeoProvider
281+ baseUrl = { import .meta .env .VITE_ASGARDEO_BASE_URL }
282+ clientId = { import .meta .env .VITE_ASGARDEO_CLIENT_ID }
283+ // ... other configuration
284+ preferences = { {
285+ i18n: {
286+ language: ' fr-FR' ,
287+ bundles: {
288+ ' fr-FR' : fr_FR ,
289+ },
290+ },
291+ }}
292+ >
293+ <App />
294+ </AsgardeoProvider >
295+ ```
296+
297+ For more details on the i18n preferences interface, see the [ ` I18nPreferences ` ] ( packages/javascript/src/models/config.ts#L232 ) .
298+
299+ - ** Verify the translations**
300+
301+ - Navigate through your application's authentication flows
302+ - Check that all UI text appears in your new language
303+ - Verify that buttons, labels, error messages, and other UI elements display the correct translations
304+ - Test different authentication scenarios (sign-in, sign-up, errors) to ensure comprehensive coverage
305+
306+ - ** Test text direction (if applicable)**
307+
308+ For right-to-left languages, ensure that the UI layout adjusts correctly based on the ` direction ` property in your metadata.
309+
231310##### Update documentation
232311
233312Update any relevant documentation to mention the newly supported language.
0 commit comments