1
00:00:04,170 --> 00:00:10,470
Hello, everyone, and welcome back in this lesson, we're going to talk about another internationalization

2
00:00:10,470 --> 00:00:16,890
youth case, which is very similar to the plural youth case, where we have different alternative expressions

3
00:00:16,890 --> 00:00:20,830
that are going to be applied depending on the value of a numeric amount.

4
00:00:21,000 --> 00:00:26,900
Sometimes we have the same situation, but it's not necessarily in the context of a numeric amount.

5
00:00:26,940 --> 00:00:28,110
Let's give an example.

6
00:00:28,230 --> 00:00:33,450
If we switch over here to the Coast Guard component and we expect its template, we are going to notice

7
00:00:33,450 --> 00:00:40,320
that we have here different translatable expressions depending on the value of the course category properties.

8
00:00:40,320 --> 00:00:44,240
So we have heard the strings beginner, intermediate and advanced.

9
00:00:44,460 --> 00:00:51,660
Now, one way of getting this translated would be to add the eatin' end to each of these DVS so that

10
00:00:51,660 --> 00:00:54,960
each of the strings shows up in the extraction.

11
00:00:55,110 --> 00:01:00,660
But instead of doing this, we would like to do this in a way that would give the translator some more

12
00:01:00,660 --> 00:01:02,700
context about what is going on.

13
00:01:02,880 --> 00:01:10,050
Instead of seeing these free expressions as completely unrelated in the translator user interface,

14
00:01:10,170 --> 00:01:16,680
we would like these expressions to show up as being tightly linked and alternatives to one another.

15
00:01:16,920 --> 00:01:23,280
This is going to give the translator a lot more context about these terms to give that context to the

16
00:01:23,280 --> 00:01:23,960
translator.

17
00:01:23,970 --> 00:01:30,810
We are going to replace here the use of energy switch by an expression very similar to the plural expression

18
00:01:30,810 --> 00:01:31,840
that we wrote here.

19
00:01:32,010 --> 00:01:37,710
Let's then refactor our code in order to use these new ETN mechanism.

20
00:01:37,740 --> 00:01:41,850
We are going to move here to the use of the energy switch case clause.

21
00:01:41,860 --> 00:01:48,780
We're going to leave here the deal with class category and say that we are going to add a new internationalization

22
00:01:48,780 --> 00:01:49,670
expression.

23
00:01:49,680 --> 00:01:57,270
Let's add a couple of curly braces to the limit, the expression and let's apply here the N attribute.

24
00:01:57,450 --> 00:02:03,500
Now let's hear what is going to trigger our alternative choice in this case.

25
00:02:03,510 --> 00:02:08,430
We know that is going to be the category property of the course member variable.

26
00:02:08,550 --> 00:02:11,550
We are going to add here a comma and we are going to adhere here.

27
00:02:11,550 --> 00:02:13,430
The select keyword.

28
00:02:13,620 --> 00:02:18,420
These will indicate that this is a selection of alternative expressions.

29
00:02:18,600 --> 00:02:24,430
Next, we are going to start adding here the multiple cases that we have available for our expression.

30
00:02:24,480 --> 00:02:30,260
So first, we are going to say that whenever the course category variable contains the value beginner,

31
00:02:30,390 --> 00:02:36,360
in that case we are going to be bringing to the screen the following string after the Virginia case.

32
00:02:36,360 --> 00:02:42,150
We are going to be specifying here in a similar way the intermediate case for which we are going to

33
00:02:42,150 --> 00:02:44,260
output the value intermediate.

34
00:02:44,280 --> 00:02:50,940
And finally, we are going to apply here the advanced case for which we are going to write the string

35
00:02:50,940 --> 00:02:51,740
advanced.

36
00:02:51,750 --> 00:02:55,350
So here we have our expression completed.

37
00:02:55,470 --> 00:03:01,530
In order to see this expression in action, we are going to need a list containing courses with all

38
00:03:01,530 --> 00:03:02,350
the categories.

39
00:03:02,350 --> 00:03:07,260
So we are going to switch here to our application component and we are going to remove here the use

40
00:03:07,260 --> 00:03:09,360
of the filter by category pipe.

41
00:03:09,390 --> 00:03:15,390
Next, we are going to head over to our terminal and we are going to restart here Yanguas Clay, once

42
00:03:15,390 --> 00:03:17,310
we have our server up and running.

43
00:03:17,310 --> 00:03:21,720
If we try things out, we are going to see that we get an error and the blank screen.

44
00:03:21,720 --> 00:03:25,280
So it looks like our expression here was missing something.

45
00:03:25,290 --> 00:03:28,550
And what we are missing is a comma here after the select.

46
00:03:28,590 --> 00:03:29,910
So let's add that.

47
00:03:29,910 --> 00:03:34,700
Let's reload the application and let's confirm that everything is working correctly.

48
00:03:34,740 --> 00:03:39,630
So if we have a look here at our course list, we are going to see that there is something strange here

49
00:03:39,630 --> 00:03:40,770
with the first course.

50
00:03:40,770 --> 00:03:45,750
But the other courses we can see that we have here the label correctly displayed.

51
00:03:45,780 --> 00:03:52,710
So we can see this expression here is an alternative in some cases to engy switch with the advantage

52
00:03:52,710 --> 00:03:56,070
that it's compatible with the ETN extractor.

53
00:03:56,100 --> 00:04:00,990
Now, let's have a look at what could have happened here in this first course where we are getting here,

54
00:04:00,990 --> 00:04:01,680
this error.

55
00:04:01,800 --> 00:04:08,340
And if we expect the data, we are going to see that indeed we have here a situation where the category

56
00:04:08,340 --> 00:04:10,410
property of the course is missing.

57
00:04:10,410 --> 00:04:13,140
Let's then adhere to the category property.

58
00:04:13,140 --> 00:04:16,019
Let's set the category to intermediate.

59
00:04:16,140 --> 00:04:20,490
Now, if we were to lower the application, we are going to see that everything is working correctly

60
00:04:20,490 --> 00:04:21,470
as expected.

61
00:04:21,570 --> 00:04:26,040
So our alternative select expression is working.

62
00:04:26,040 --> 00:04:28,200
Let's now switch over here to the terminal.

63
00:04:28,200 --> 00:04:33,800
We are going to stop the angular clay and we are going to run our Aetate in an extractor.

64
00:04:33,930 --> 00:04:38,780
Now that the extraction is finished, let's have a look here at our messages file.

65
00:04:38,910 --> 00:04:41,190
If we open it, we are going to see that now.

66
00:04:41,190 --> 00:04:45,460
We have here another translation unit that is available here.

67
00:04:45,480 --> 00:04:50,770
So as you can see, our expression is here available with all the alternatives.

68
00:04:50,790 --> 00:04:54,870
So, again, this is going to be displayed in a user friendly way to the translator.

69
00:04:54,870 --> 00:04:59,690
And the translator will know that clearly these are alternative expressions.

70
00:04:59,730 --> 00:05:00,010
Let.

71
00:05:00,130 --> 00:05:05,570
Now simulate the translation process, we are going to simulate that we send this file to a translator.

72
00:05:05,590 --> 00:05:11,650
We're going to get a translated file and we are going to run the application in an alternative language.

