Skip to content

SyncfusionExamples/Localization-for-xamarin-forms-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Localization for SfChat

Localization is the process of translating application resources into different languages for specific cultures. SfChat uses the following static text that can be localized in application level:

  • Today
  • Type a Message

Sample

App.xaml.cs:

        public App()
        {
            InitializeComponent();
            MainPage = new ChatPage();
            ChatResourceManager.Manager = new ResourceManager("LocalizationDemo.Syncfusion.SfChat.XForms", this.GetType().GetTypeInfo().Assembly);
            // the ResourceManager class constructor has two parameters.
            // 1. ResXPath => Full path of the resx file in the application. Here in the above line GettingStarted refers to the namespace of the Application
            // 2. Assembly => Application assembly (PCL)

            // Sets the required culture to the static texts in the control.
            if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS)
            {
                DependencyService.Get<ILocalize>().SetLocale(new CultureInfo("fr-FR"));
            }
        }

Requirements to run the demo

To run the demo, refer to System Requirements for Xamarin.

Troubleshooting

Path too long exception

If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.

About

This sample describes Localization in Xamarin.Forms chat application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages