Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:02,120 --> 00:00:04,930
Now let's start with step number one
2
00:00:04,930 --> 00:00:06,260
in this lecture.
3
00:00:06,260 --> 00:00:08,140
Let's double check our code
4
00:00:08,140 --> 00:00:11,410
and verify that we're happy with it.
5
00:00:11,410 --> 00:00:14,550
Now for this I'm back in this blog project
6
00:00:14,550 --> 00:00:17,580
which we worked on in the last course section.
7
00:00:17,580 --> 00:00:19,570
If you didn't follow along there,
8
00:00:19,570 --> 00:00:22,580
you find my latest snapshot attached.
9
00:00:22,580 --> 00:00:27,120
Just be aware that the MongoDB credentials I'm using here,
10
00:00:27,120 --> 00:00:28,730
won't work for you.
11
00:00:28,730 --> 00:00:32,189
This is my cluster and I invalidated this user
12
00:00:32,189 --> 00:00:34,770
and its password after recording this course.
13
00:00:34,770 --> 00:00:38,440
So you will need to bring your own MongoDB database
14
00:00:38,440 --> 00:00:40,520
and your own connection string
15
00:00:40,520 --> 00:00:43,240
to make that API route work.
16
00:00:43,240 --> 00:00:44,770
Other than that you can continue
17
00:00:44,770 --> 00:00:47,590
with what I shared here as an attachment.
18
00:00:47,590 --> 00:00:50,710
And therefore, now we want to double check this setup
19
00:00:50,710 --> 00:00:52,580
and see if we're happy with it.
20
00:00:52,580 --> 00:00:56,160
Now, of course, such a validation is an ongoing process
21
00:00:56,160 --> 00:00:59,160
and you will always find improvement potential,
22
00:00:59,160 --> 00:01:03,070
but generally what we have here shouldn't be too bad.
23
00:01:03,070 --> 00:01:07,930
We are, for example, already using Nextimage.
24
00:01:07,930 --> 00:01:11,400
So the optimized images in all the places
25
00:01:11,400 --> 00:01:13,610
where we are working with images,
26
00:01:13,610 --> 00:01:15,690
even in our post contents.
27
00:01:15,690 --> 00:01:19,110
Even there we make sure that images
28
00:01:19,110 --> 00:01:23,770
that are part of our posts are rendered with Nextimage.
29
00:01:23,770 --> 00:01:26,300
And that is a great optimization
30
00:01:26,300 --> 00:01:29,730
because that loads images only when they are needed.
31
00:01:29,730 --> 00:01:34,380
It loads them lazily, and it also shrinks them in size.
32
00:01:34,380 --> 00:01:36,250
Now, speaking of lazy loading,
33
00:01:36,250 --> 00:01:41,250
that also is a concept we know in general in React,
34
00:01:41,460 --> 00:01:45,320
and most prominently when working with just React,
35
00:01:45,320 --> 00:01:49,810
without NextJS, you might want to lazy load your routes.
36
00:01:49,810 --> 00:01:52,610
So that the code for a given page
37
00:01:52,610 --> 00:01:56,620
is only downloaded if you're visiting that page,
38
00:01:56,620 --> 00:02:00,170
and it's not downloaded if you not visit the page.
39
00:02:00,170 --> 00:02:03,210
The great thing here is that NextJS
40
00:02:03,210 --> 00:02:06,240
has this kind of lazy loading built in.
41
00:02:06,240 --> 00:02:08,330
You don't need to worry about it.
42
00:02:08,330 --> 00:02:11,560
Your different pages, which we have here,
43
00:02:11,560 --> 00:02:13,330
are already lazy loaded.
44
00:02:13,330 --> 00:02:16,610
So the code for them is only fetched on demand,
45
00:02:16,610 --> 00:02:18,410
when we visit a page.
46
00:02:18,410 --> 00:02:20,540
So that built-in lazy loading
47
00:02:20,540 --> 00:02:23,000
is a very nice feature to have.
48
00:02:23,000 --> 00:02:25,740
Now regarding the metadata, which we should add.
49
00:02:25,740 --> 00:02:28,740
I'm happy with the amount of metadata, like title,
50
00:02:28,740 --> 00:02:33,210
and this description tag I added in the last course section.
51
00:02:33,210 --> 00:02:35,810
Of course, there is more you might want to add.
52
00:02:35,810 --> 00:02:38,840
Favicons, images which are displayed
53
00:02:38,840 --> 00:02:42,380
if you share a page through Facebook or Twitter.
54
00:02:42,380 --> 00:02:44,730
So these little preview images and so on.
55
00:02:44,730 --> 00:02:46,900
These are all extra kinds of data
56
00:02:46,900 --> 00:02:49,290
you could add into your head section,
57
00:02:49,290 --> 00:02:52,530
but for this demo here for this project,
58
00:02:52,530 --> 00:02:54,880
the current amount of metadata which we added,
59
00:02:54,880 --> 00:02:56,690
is fine for me.
60
00:02:56,690 --> 00:02:59,640
And therefore at the moment, I'm happy with that code.
61
00:02:59,640 --> 00:03:01,400
I think it should be fine
62
00:03:01,400 --> 00:03:03,670
but we will soon revalidate this
63
00:03:03,670 --> 00:03:05,990
by doing a test build, of course.
64
00:03:05,990 --> 00:03:09,293
Nonetheless, for the moment let's move on to the next step.
5045
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.