All language subtitles for 017 Loading Paths Dynamically_Downloadly.ir_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
ko Korean
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
fa Persian Download
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

Original subtitles

So now we learned about getStaticPaths.

At the moment

the way we use it is still a bit unrealistic though

because I have hard coded my PID values here

into this function.

And in reality, we would be fetching

this kind of information

from a database or a file as well.

So therefore in reality, we would basically

just repeat this code here

and would wrap that code

and just outsource it into a separate function.

Async function called get data

where I then returned data.

And since it's async, we can use a weight in there

and then we can just get our data here

by calling get data

and waiting this here in getStatic prompts.

And we can do the same in getStaticPaths.

So a little bit of refactoring

to have no code duplication.

With that we get the data.

And now here in getStaticPaths.

We want to use the data to read all the IDs

we want to support.

So for this, we could get our IDs array here

by going through all the data pieces.

Now the data we get back here

by the way will already be parsed json

since we do that and get data.

So it will be a JavaScript object.

So here IDs then should be an array.

And in dummy backend, we have this products array.

So in the end

what we want to do is you want to access data.products

and then just map this array of complete product objects

into an array of just product IDs.

Just like this, for example.

Just extracting the ID

for every product and then having such an IDs array here.

And then we need to translate this IDs array

into an array of such objects.

So here we could then create another object params

which has a number array.

But we create this array

by going through the ideas and mapping these IDs

such that every ID is mapped into an object.

And we need to wrap this

in extra brackets here, extra parentheses,

so that this is not considered as the function body

but that we instead inline return a new object

for every ID and object with a parent's key

which then holds another object with a PID key

which has this ID as a value.

And that's then repeated for every ID.

So we end up with an array full off such objects

which have exactly that structure we need down there

so that we can set paths equal to params here

where we name this paths with params,

maybe whoops

paths with params just like this.

And of course we could perform these two operations

in one single step as well.

I'm just using two steps here to hopefully

make this a bit easier to understand.

And then with that, if I now saved this

it still works as before.

Everything still works as before

now also all the pages are pre-generated again, by the way

because I am going through all the products here.

So now we can also set fallback to false again

because we are loading all possible IDs anyways

and that's of course, a bit more realistic here

because typically you would not pre hard code

all supported values here.

Typically you don't know all dynamic values

in advance as a developer

but instead you would fetch them from the same data source

as the actual data is then fetched from later.

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