All language subtitles for 018 Adding a _Not Found_ Page_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:02,020 --> 00:00:03,550 In the last lecture 2 00:00:03,550 --> 00:00:05,960 we worked on this quote detailed page 3 00:00:05,960 --> 00:00:10,960 and we made sure that if I enter an unknown quote ID here 4 00:00:11,110 --> 00:00:13,433 I get some fallback text here. 5 00:00:14,360 --> 00:00:17,190 But what if I enter a totally unknown route 6 00:00:17,190 --> 00:00:18,160 to begin with, 7 00:00:18,160 --> 00:00:20,970 something like my domain slash hello 8 00:00:21,900 --> 00:00:24,200 then we have this blank page. 9 00:00:24,200 --> 00:00:27,379 And in reality we typically instead 10 00:00:27,379 --> 00:00:29,318 when I show some 404 page 11 00:00:29,318 --> 00:00:31,767 a fallback page that tells the user 12 00:00:31,767 --> 00:00:34,070 that this page doesn't exist 13 00:00:34,070 --> 00:00:36,243 instead of just showing a blank page. 14 00:00:38,180 --> 00:00:42,080 And we can also add such a 404 page 15 00:00:42,080 --> 00:00:46,163 a not found page with react router as well. 16 00:00:47,180 --> 00:00:48,013 For this all, 17 00:00:48,013 --> 00:00:51,430 first of all, add a new page here in the pages folder. 18 00:00:51,430 --> 00:00:54,890 And that's the not found JS file. 19 00:00:54,890 --> 00:00:58,010 And in there, I'll add the, not found component 20 00:00:59,150 --> 00:01:03,400 and export this here and then there, 21 00:01:03,400 --> 00:01:07,470 I'll just return a div with a class name off centered. 22 00:01:07,470 --> 00:01:10,820 And now that's not as CSS module class name, 23 00:01:10,820 --> 00:01:13,470 but a globally defined CSS class name 24 00:01:13,470 --> 00:01:16,213 defined here in this index CSS file. 25 00:01:17,120 --> 00:01:20,770 And then this div I'll then just say, page not found. 26 00:01:20,770 --> 00:01:23,140 And of course you can change the content 27 00:01:23,140 --> 00:01:26,223 of this page and style it however you want. 28 00:01:27,420 --> 00:01:31,550 Now with that we have this not found page component to find 29 00:01:31,550 --> 00:01:32,990 but how do we now make sure 30 00:01:32,990 --> 00:01:34,200 that it is showing up if a user enters 31 00:01:34,200 --> 00:01:38,560 some unsupportive path? 32 00:01:38,560 --> 00:01:42,260 For this we can go back to all our root route definition. 33 00:01:42,260 --> 00:01:45,050 'Cause here we are defining all the routes 34 00:01:45,050 --> 00:01:47,760 our application supports. 35 00:01:47,760 --> 00:01:50,530 Now, if we go through that switch statement 36 00:01:50,530 --> 00:01:53,630 and we didn't have a single match of, for example, 37 00:01:53,630 --> 00:01:56,400 for a slash hello, we don't have a match here. 38 00:01:56,400 --> 00:01:58,980 Then we leave the switch statement without a match. 39 00:01:58,980 --> 00:02:01,163 And hence nothing shows up on the screen, 40 00:02:02,100 --> 00:02:05,810 therefore to show a fallback and not found page. 41 00:02:05,810 --> 00:02:08,919 The approach typically is that we add one route here 42 00:02:08,919 --> 00:02:13,460 at the end, which is looked at if no other route matched 43 00:02:13,460 --> 00:02:16,360 where we match all incoming requests. 44 00:02:16,360 --> 00:02:17,962 So to say. 45 00:02:17,962 --> 00:02:20,120 So where we match all URLs 46 00:02:20,120 --> 00:02:22,830 and we do that by setting the path to a star 47 00:02:23,760 --> 00:02:28,580 This wild card character signals to react router 48 00:02:28,580 --> 00:02:33,580 that any path any URL should match this route. 49 00:02:34,240 --> 00:02:37,030 And therefore this route has to come last 50 00:02:37,030 --> 00:02:39,846 so that it does not consume one of the requests 51 00:02:39,846 --> 00:02:42,363 to one of the actual routes we have. 52 00:02:43,360 --> 00:02:47,140 But if we didn't have any match up to this point 53 00:02:47,140 --> 00:02:51,190 then we want to match all URLs with this route. 54 00:02:51,190 --> 00:02:54,390 And then just rendered this not found page here. 55 00:02:54,390 --> 00:02:59,390 So here I'll now import not found from pages 56 00:03:00,190 --> 00:03:01,203 Not found. 57 00:03:02,520 --> 00:03:05,050 And output does not found component 58 00:03:05,050 --> 00:03:09,900 here in this match all route here, 59 00:03:09,900 --> 00:03:14,050 which is only considered if no other route matched. 60 00:03:14,050 --> 00:03:17,000 And with this, if I saved this for hello, 61 00:03:17,000 --> 00:03:19,730 we get this page not found text. 62 00:03:19,730 --> 00:03:20,563 On the other hand, 63 00:03:20,563 --> 00:03:22,530 if I do enter slash quotes. 64 00:03:22,530 --> 00:03:25,480 So I do visit with one of my supported pages. 65 00:03:25,480 --> 00:03:27,537 Then I see that page. 66 00:03:27,537 --> 00:03:30,720 And with this, we also added this not found page 67 00:03:30,720 --> 00:03:34,020 which of course is a never common requirement you might have 68 00:03:34,020 --> 00:03:35,483 in your applications. 5259

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.