All language subtitles for 001 Static Assets_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
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
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

Thanks to some styling,

our website is starting to look a bit nicer.

But it's still quite plain.

What we could do is add some images,

maybe one for each game we review.

We'll also want to style these links by the way,

but let's start from a review page.

We could show an image here,

representing this game.

But where should we put the images in our project?

We can create a folder, at the top level,

called "public".

Any files we put inside that folder

will be treated as "static assets".

Just to show you how it works,

let's create a file named "test.txt",

and write some text, like "Hello world!"

That file will now be served

by the Next.js server,

and we can access it as "/test.txt".

So, any file in the "public" folder

will be returned exactly as it is.

That's how we can serve images as well.

If you look under the Resources for this lecture,

you'll find a file called "images.zip",

that contains a few pictures for our game reviews.

So you can download this package to your machine.

And you can save it directly inside

the "next-reviews" project,

in the "public" folder.

So this will download it there.

And I'll open it in Finder, that's

the macOS File Manager.

We can unzip this file directly

inside the "public" folder,

and it will create its own "images" folder.

We can also delete these other two files now.

Ok. We have some images to use in our project.

Let's go back to our application.

And I'll reload the Home page.

"test.txt" doesn't exist any more.

But inside "public" there's

now an "images" folder,

that contains three jpeg files.

"stardew-valley.jpg" is a screenshot

from the Stardew Valley game.

Then there's one for "hollow-knight".

And the third one is "hellblade".

We don't have a page for this game yet,

but we'll add one later on.

Anyway, we have some images.

Since they're inside the "public" folder,

we can access them directly as "/images/hellblade.jpg"

for example,

and the browser will display it,

because the Next.js server returns

the jpeg file as it is.

Ok, so let's use those images in our pages.

Let's start from the Hollow Knight review,

that I'll open in the browser as well.

Here we can add an image after the Heading,

and we'll use the standard HTML

"img" element for now.

The path will be "/images/hollow-knight.jpg".

Then we should set the "alt" attribute,

for accessibility.

But we can leave it empty,

because this will be a purely decorative image.

The heading already contains the game title.

And we can see the image on the page.

Now, it's good practice to also

specify the dimensions,

so that the browser can reserve the right

amount of space when rendering the page.

Let's set the "width" to 640 pixels,

and the "height" to 360.

The original size is 1280x720,

so this will preserve the aspect ratio,

but we don't want the image

to take up the whole page.

We want to be able to see the text as well.

If we're on a smaller screen,

it will automatically shrink.

Now, let's add some styles.

We'll use Tailwind CSS classes as usual.

Let's make it "rounded",

just because rounded corners look nicer.

We could also add some margin at the bottom,

to leave some space before the text below.

And I think that's good enough for this example.

Let's copy this code

and do exactly the same in the other review page,

that is for Stardew Valley.

Let me show the right page.

So, we can paste the image code here,

but we need to change it to "stardew-valley.jpg".

And if we save, we see the right image.

Ok. It's much better with a screenshot.

So, to recap: we just need to put our

images inside the "public" folder

and the Next.js server will return

them directly as they are.

You can use the same approach

for any other static asset,

like videos, audio files, PDF documents,

and so on.

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