Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n added and used in drawer component #11

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

madhushree007
Copy link

Feature: i18n Internationalisation
This PR implements i18n. A dropdown/picker has been added to select the language. The text on the screen changes as per selected laguage.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@giolaq
Copy link
Contributor

giolaq commented Oct 12, 2024

Thank you Nice Work!
Can you add the dependencies needed?
Also make sure you test the tv app across different TVs platforms: at least Android TV, tvOS and web.

Check if the component is focusable and navigable by using the remote (or the keyboard in case of web.

As it's a TV app it's important to provide a component usable from the distance and with a TV friendly design.

Check https://developer.android.com/design/ui/tv/samples/jet-stream for some inspiration.

app/_layout.tsx Outdated
@@ -6,6 +6,8 @@ import { useCallback, useEffect } from 'react';

import { MenuProvider } from '../components/MenuContext';
import { GoBackConfiguration } from './remote-control/GoBackConfiguration';
import { I18nextProvider } from 'react-i18next';
import i18n from '@/components/i18n'; // Initialize i18n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: please remove the comment

import { initReactI18next } from 'react-i18next';
import LanguageDetector from 'i18next-browser-languagedetector';

// Import translation files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: remove comment

translation: fr,
},
},
lng: 'en', // Default language
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: same as above. Please remove comments

@@ -7,6 +7,7 @@ import { SpatialNavigationFocusableView, SpatialNavigationRoot, SpatialNavigatio
import { Direction } from '@bam.tech/lrud';
import { scaledPixels } from '@/hooks/useScale';
import { LinearGradient } from 'expo-linear-gradient';
import { useTranslation } from 'react-i18next';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please commit the package.json for the i18 npm package.

@madhushree007
Copy link
Author

@Neha I have updated the PR as per your comment.

@madhushree007
Copy link
Author

@giolaq @Neha I am getting an error on tvOS simulator
Invariant Violation: requireNativeComponent: "RNCPicker" was not found in the UIManager.

Although I have replaced Picker with RNPickerSelect. I am still trying to find the fix for it.

@Neha
Copy link
Contributor

Neha commented Oct 16, 2024

@giolaq @Neha I am getting an error on tvOS simulator Invariant Violation: requireNativeComponent: "RNCPicker" was not found in the UIManager.

Although I have replaced Picker with RNPickerSelect. I am still trying to find the fix for it.

Thank you @madhushree007 . Can you share where the language selector will be placed? and how the UI will look.

@madhushree007
Copy link
Author

@Neha It is already placed above the Menu. Please have a look at the screenshot.
Screenshot 2024-10-16 at 16 19 27
It is visible and working in the web view.

@giolaq
Copy link
Contributor

giolaq commented Oct 16, 2024

What about putting the language choices in a Setting Screen? I think it's the right place for all the configurations.

@madhushree007
Copy link
Author

@giolaq Do we have a Setting Screen? Or shall I create one?

Perhaps we could have something similar to this
Screenshot 2024-10-16 at 21 30 36

@giolaq
Copy link
Contributor

giolaq commented Oct 16, 2024

I've created this to implement the Setting Screen

@giolaq giolaq marked this pull request as draft October 18, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants