Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:02,090 --> 00:00:04,630
So we got this JSX code here
2
00:00:04,630 --> 00:00:08,370
which is basically HTML code inside of JavaScript.
3
00:00:08,370 --> 00:00:12,800
Indeed, JSX stands for JavaScript XML
4
00:00:12,800 --> 00:00:17,220
because HTML in the end is XML, you could say.
5
00:00:17,220 --> 00:00:20,370
So we got this HTML code in JavaScript.
6
00:00:20,370 --> 00:00:22,400
And again, this is really important.
7
00:00:22,400 --> 00:00:25,840
This only works because there are transformation steps
8
00:00:25,840 --> 00:00:29,220
running behind the scenes because of this process
9
00:00:29,220 --> 00:00:31,600
does NPM start process which we started,
10
00:00:31,600 --> 00:00:33,910
which transformed as JavaScript code
11
00:00:33,910 --> 00:00:36,460
to more browser friendly code
12
00:00:36,460 --> 00:00:38,543
before everything is being served here.
13
00:00:39,470 --> 00:00:41,660
And indeed you can see that transformed code
14
00:00:41,660 --> 00:00:42,930
if you want to.
15
00:00:42,930 --> 00:00:45,360
Simply open up the developer tools
16
00:00:45,360 --> 00:00:46,870
and here I'm using Chrome,
17
00:00:46,870 --> 00:00:49,940
which is the browser I do recommend for development.
18
00:00:49,940 --> 00:00:53,500
Simply open up the developer tools in Chrome
19
00:00:53,500 --> 00:00:56,220
by going to view developer developer tools,
20
00:00:56,220 --> 00:00:58,710
or by using that shortcut.
21
00:00:58,710 --> 00:01:03,710
And in these developer tools here go to the sources tab.
22
00:01:04,430 --> 00:01:06,430
And this shows all the sources,
23
00:01:06,430 --> 00:01:08,670
all the script files for example,
24
00:01:08,670 --> 00:01:11,623
which were downloaded as part of this page.
25
00:01:13,040 --> 00:01:15,970
Now in here, you'll see a couple of folders
26
00:01:15,970 --> 00:01:20,250
but you should see some static /JS folder or something
27
00:01:20,250 --> 00:01:25,200
like that, which should hold a couple of JavaScript files.
28
00:01:25,200 --> 00:01:29,270
Now the exact number and names of these files might differ.
29
00:01:29,270 --> 00:01:32,270
But ultimately, if you click through these files
30
00:01:32,270 --> 00:01:35,920
you should see some code which looks fairly cryptic.
31
00:01:35,920 --> 00:01:38,880
And which is definitely not the code we wrote here.
32
00:01:38,880 --> 00:01:43,560
Or we have here in these two simple JavaScript files.
33
00:01:43,560 --> 00:01:46,420
Well, it turns out that this is this transformed code
34
00:01:46,420 --> 00:01:49,348
and it's quite a complex code, as you can tell
35
00:01:49,348 --> 00:01:52,440
because React supports many features.
36
00:01:52,440 --> 00:01:56,181
And this code does not just contain our source code
37
00:01:56,181 --> 00:01:59,770
but the whole react library source code
38
00:01:59,770 --> 00:02:03,800
and the whole react Dom library source code.
39
00:02:03,800 --> 00:02:06,750
So the code in these files is not just our code
40
00:02:06,750 --> 00:02:09,259
but the entire React package code.
41
00:02:09,259 --> 00:02:10,923
That's something to keep in mind.
42
00:02:12,450 --> 00:02:15,810
Now in these files and the main chunk JS file here
43
00:02:15,810 --> 00:02:17,120
for example,
44
00:02:17,120 --> 00:02:21,110
you see a function named app, somewhere in there.
45
00:02:21,110 --> 00:02:22,730
You might need to search for it
46
00:02:22,730 --> 00:02:26,650
with control F but somewhere in there in these files
47
00:02:26,650 --> 00:02:29,333
you should find your app function.
48
00:02:30,420 --> 00:02:33,310
But of course, this function looks quite different
49
00:02:34,211 --> 00:02:35,570
to the app function we have here.
50
00:02:35,570 --> 00:02:37,600
That's a very lean function.
51
00:02:37,600 --> 00:02:40,223
This function is not so lean.
52
00:02:41,322 --> 00:02:46,322
Well in the end debts is transformed code.
53
00:02:46,510 --> 00:02:51,440
You could say that is that code, which runs in the browser
54
00:02:51,440 --> 00:02:52,940
which is not the code we wrote
55
00:02:52,940 --> 00:02:56,000
but that's what this code is transformed to.
56
00:02:56,000 --> 00:02:56,833
And if you have
57
00:02:56,833 --> 00:03:00,160
a look at this transformed code and even look might change
58
00:03:00,160 --> 00:03:03,020
over time, but it will definitely not look like this.
59
00:03:03,020 --> 00:03:06,380
If you have a look at this transformed code that probably
60
00:03:06,380 --> 00:03:08,690
is not code we would like to write.
61
00:03:08,690 --> 00:03:11,890
And that's why we have these transformation steps
62
00:03:11,890 --> 00:03:15,480
because we can use this special JSX Syntex,
63
00:03:15,480 --> 00:03:18,570
which is not normally supported in the browser
64
00:03:18,570 --> 00:03:20,570
whilst we're writing our code
65
00:03:20,570 --> 00:03:23,920
and still it'll automatically be transformed to code
66
00:03:23,920 --> 00:03:27,390
which does run in the browser so that we have the best
67
00:03:27,390 --> 00:03:30,540
of both worlds code, which works in the browser
68
00:03:30,540 --> 00:03:33,490
which obviously is important and code, which is easy to
69
00:03:33,490 --> 00:03:35,690
write for us as a developer.
70
00:03:35,690 --> 00:03:37,990
And I'm just putting so much emphasis on this
71
00:03:37,990 --> 00:03:40,530
because that can be super confusing.
72
00:03:40,530 --> 00:03:42,330
If you're new to React,
73
00:03:42,330 --> 00:03:45,820
you do know some basic JavaScript at least you should.
74
00:03:45,820 --> 00:03:48,130
And all of a sudden you see code like this
75
00:03:48,130 --> 00:03:50,105
which is not regular JavaScript.
76
00:03:50,105 --> 00:03:53,350
Well, this is just developer friendly code
77
00:03:53,350 --> 00:03:56,493
which we can write, which is transformed behind the scenes.
6222
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.