top of page

The learning experience

These pages inform the user of the theories and ideas behind Adverse Impact in multiple languages.

Learning.png

Challenges

A list of some challenges we faced with this page.

The XAML behind the theories page

A sample of the XAML code showcasing the "How we connect" part of the theory

We wanted to base our app on research. We gathered theories from scientific resources and wrote a summary for ourselves. After writing it we decided to put it in the app. It would be a way for us to help educate our users on the subject of Adverse Impact. However... displaying a PDF would proof to be a challenge that we eventually fixed but never solved.

​

After trying to find a solution to portray PDF's in Xamarin.Forms we eventually failed. Instead of giving up, we went for the longer road. We hard coded the complete layout of our PDF in the XAML. Adding the text to our ResX files for the translations. Eventually resulting in a long XAML file that showcases the complete theory. 

​

In the image above a small segment of the XAML file can be seen. The result can be seen on this page as well.

The result of the XAML in the app

The result of the "how we connect" part in the app

This screenshot showcases the result of the hard coded XAML file. Even though we are happy with the outcome, this was far from an ideal solution. However... the goal was achieved.

​

In future projects we aspire to learn more ways of showcasing our information. Which will help solve issues like these more efficiently.

The RESX manager

The keys and their different translations

From the beginning we wanted to make our app in multiple languages. We started to localize our text instead of hard coding it. Localization has 2 elements:

  • The phone culture

  • The corresponding ResX file

​

Each phone has a "culture". In basic terms culture means the country and language your phone is set to.

  • For example: My phone's default culture is "nl-BE".

    • nl = Dutch (Nederlands)

    • be = Belgium

  • If I changed my settings and made my language french it would become "fr-BE"

    • fr = French

    • be = Belgium

​

The second element is a ResX file. ResX files contain the same information in different languages.

  • The key for a specific set information is the same in every ResX file.

In the code you refer to a key then the culture of your phone determines which ResX file is used. In our app there are two ResX files: nl-BE (default) and en-US.

  • For example: we want to add a text in both Dutch and English welcoming the user to our app.
    • In the nl-BE file we add
      • Key = WelcomeMessage
      • Value = "Hey welkom in onze app!"
    • In the en-US file we add
      • Key = WelcomeMessage
      • Value = "Hi welcome to our app!"

​

In the XAML code we refer to the text of our message as "Translate WelcomeMessage". If the user's phone culture is set to en-US the English translation will be displayed. Otherwise our default ResX file will be chosen nl-BE. The upside of working this way is that we can easily give our app more languages. The text is'nt hard coded so we just have to add an extra ResX file containing the correct translations. Our app is capable of displaying a new language instantly.

​

To help us maintain these files we used a plugin called ResXFilesManager. The translation command in XAML is added by using the Xamarin.Forms.Community.Toolkit.

bottom of page