1
00:00:04,120 --> 00:00:06,350
Hello, everyone, and welcome back.

2
00:00:06,370 --> 00:00:11,060
In this lesson, we are going to continue our deep dive into angular internationalization.

3
00:00:11,290 --> 00:00:17,560
Let's start by understanding in detail how the angular internationalization identifiers work.

4
00:00:17,740 --> 00:00:24,310
So so far, we were translating here a couple of strings in our application that were fairly straightforward.

5
00:00:24,310 --> 00:00:31,480
But sometimes a given term has a certain meaning that will depend on the context of the sentence.

6
00:00:31,690 --> 00:00:37,720
The problem is that this text here could be translated into different forms, depending on the context

7
00:00:37,720 --> 00:00:39,220
onto which is being used.

8
00:00:39,250 --> 00:00:45,010
So sometimes we want to provide to the translator a bit more information about the text rather than

9
00:00:45,010 --> 00:00:46,090
the text itself.

10
00:00:46,240 --> 00:00:50,630
If that's the case, we can do so using the ETN attribute.

11
00:00:50,650 --> 00:00:56,340
So here in this attribute, we can specify here the meaning of the term.

12
00:00:56,350 --> 00:01:01,380
In this case, we would like to specify here that this is meant to be a welcome message.

13
00:01:01,630 --> 00:01:03,400
So we're going to specify that here.

14
00:01:03,490 --> 00:01:07,820
We are going to add here in this attribute some information about the context.

15
00:01:07,850 --> 00:01:09,820
So this is a welcome message.

16
00:01:09,970 --> 00:01:15,740
If we need to give to the translator even more information about this particular message.

17
00:01:15,970 --> 00:01:23,110
We can do so by adding here the pipe character and then after the pipe, we can add here some description

18
00:01:23,110 --> 00:01:27,020
that is going to further help the translator to translate this message.

19
00:01:27,340 --> 00:01:30,280
So in this case, the message would be self-explanatory.

20
00:01:30,280 --> 00:01:32,770
But let's just give here an example.

21
00:01:32,770 --> 00:01:36,280
Give the user a greeting at the beginning of the course.

22
00:01:36,580 --> 00:01:42,580
Now that we have added here a meaning and the description to the string, let's quickly run here our

23
00:01:42,580 --> 00:01:46,190
extractor and see what we get in our messages file.

24
00:01:46,360 --> 00:01:47,320
Let's have a look.

25
00:01:47,350 --> 00:01:51,030
So now we have here the same two translation units.

26
00:01:51,040 --> 00:01:58,300
But this time around in the case here of the welcome message we have here, the meaning and the description

27
00:01:58,300 --> 00:02:00,420
in these Nolt tags.

28
00:02:00,610 --> 00:02:02,950
So this will be available to the translator.

29
00:02:02,950 --> 00:02:09,370
The translator is going to load this file in a user interface that is going to display these information

30
00:02:09,370 --> 00:02:10,400
to the translator.

31
00:02:10,630 --> 00:02:17,410
Notice that in most cases, the strings in our application will be self-explanatory and we will not

32
00:02:17,410 --> 00:02:21,220
need to provide extra meaning or an extra description.

33
00:02:21,370 --> 00:02:27,620
This is just in those occasional cases where we need to provide a bit more context to the translator.

34
00:02:27,880 --> 00:02:31,060
Notice that also our idea has changed.

35
00:02:31,070 --> 00:02:33,450
So it now ends in 86.

36
00:02:33,460 --> 00:02:36,520
Let's see what caused this to change.

37
00:02:36,530 --> 00:02:43,180
We are now going back here to our application component and we are going to slightly change here, for

38
00:02:43,180 --> 00:02:48,660
example, the meaning of the string without changing the string itself.

39
00:02:48,670 --> 00:02:55,240
So before we saw that changing here, the content of the string is going to change the idea and it's

40
00:02:55,240 --> 00:03:00,490
going to cause the translator to receive a new request for a translation of the term.

41
00:03:00,610 --> 00:03:02,440
Now, let's change also here, the meaning.

42
00:03:02,440 --> 00:03:05,390
Let's just add here and see what happens.

43
00:03:05,500 --> 00:03:08,380
So the idea ended here in 86.

44
00:03:08,500 --> 00:03:12,970
And if we now run again, our extractor, we are going to see that now.

45
00:03:12,970 --> 00:03:15,110
The idea ends in 31.

46
00:03:15,130 --> 00:03:21,760
So it looks like both the content of the string being translated and its meaning will trigger a new

47
00:03:21,760 --> 00:03:22,260
request.

48
00:03:22,270 --> 00:03:24,760
Translation under the form of a new idea.

49
00:03:24,880 --> 00:03:27,850
Let's now have a look to see what happens if we change here.

50
00:03:27,850 --> 00:03:34,570
The description text we are going to have here again, and not just as an example, if we now run our

51
00:03:34,570 --> 00:03:41,620
extractor again and we switch here to the messages folder, we're going to see that our idea still ends

52
00:03:41,620 --> 00:03:42,660
in 31.

53
00:03:42,790 --> 00:03:49,570
So the conclusion here is that only the content of the message itself and its meaning will trigger the

54
00:03:49,570 --> 00:03:52,240
generation of a new unique identifier.

55
00:03:52,360 --> 00:03:55,420
The description will not affect the identifier.

56
00:03:55,420 --> 00:04:00,850
And therefore, if we simply change the description, this is not going to trigger a new translation

57
00:04:00,850 --> 00:04:01,570
request.

58
00:04:01,720 --> 00:04:08,200
This mechanism of automatically generating an idea based on the string content and the meaning is great

59
00:04:08,290 --> 00:04:14,290
because it means that we just have to edit here our message and the translator will automatically get

60
00:04:14,290 --> 00:04:18,459
notified when it receives the new messages extraction file.

61
00:04:18,519 --> 00:04:25,270
However, there are some cases when we would like by some reason to manually add a translation identifier

62
00:04:25,270 --> 00:04:26,070
to the message.

63
00:04:26,260 --> 00:04:31,850
We can do that by going here to the end of the year, an attribute value.

64
00:04:31,900 --> 00:04:38,380
We have a double Etzion and after that at sine we are going to hear a unique identifier.

65
00:04:38,530 --> 00:04:42,430
Let's say that the unique identifier would be welcome message.

66
00:04:42,670 --> 00:04:47,590
So now going here back to our terminal, we are going to run again, our extractor.

67
00:04:47,740 --> 00:04:52,150
We are going to switch to our messages file and we are going to see that now.

68
00:04:52,150 --> 00:04:57,410
Our translation unit now no longer has a uniquely generated identifier.

69
00:04:57,430 --> 00:05:00,340
Instead, we are taking the idea from.

70
00:05:00,570 --> 00:05:06,990
The string here after the double st, so we have now learned how to provide extra information to the

71
00:05:06,990 --> 00:05:14,040
translator and even to create our own unique translation identify, you noticed that in most cases we

72
00:05:14,040 --> 00:05:20,490
don't need to use either the meaning, the description and especially not the unique identifier, because

73
00:05:20,490 --> 00:05:25,900
it's a lot of work having to add a unique identifier to all the labels of our application.

74
00:05:26,130 --> 00:05:31,200
It's much simpler if we have the unique identifier get automatically generated for us.

75
00:05:31,440 --> 00:05:38,760
So in most cases in your application, you will be using the eatin' and tag simply as it is without

76
00:05:38,760 --> 00:05:40,110
any attribute value.

77
00:05:40,360 --> 00:05:42,890
We should avoid using custom identifiers.

78
00:05:42,900 --> 00:05:48,590
Instead, we should rely as much as possible on the automatically generated identifiers.

79
00:05:48,600 --> 00:05:54,900
And with these simplified use of the an attribute, we are already going to be able to translate most

80
00:05:54,900 --> 00:05:56,640
of our Anjelah application.

81
00:05:56,850 --> 00:06:00,570
Now we are going to talk about a couple of translation special cases.

82
00:06:00,570 --> 00:06:05,580
We are going to talk about pluralization and we are going to talk about alternative terms.

