google / google/schema-dts

What is the best practice for localization site?

Open
#218 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.2k
Forks
57
PR merge metrics
No merged PRs in 30d

Description

I'm serving international service and there are localized pages that serve different lauguage for same contents. Each language pages include its language with its url path, such as '/en/contents' , '/ko/contents'.
I just wonder which one is the best way to inject a jsonld object for each pages.

1. write values in page's own language using `inLanguage` property
```
// korean page
{
...
name: 한국어 페이지
inLanguage : "ko"
...
}
```
```
// english page
{
...
name: English page
inLanguage : "en"
...
}
```

2. write values in all languages that I serve with `@language` keyword
```
// korean page
{
...
name : {
"ko" : "한국어 페이지",
"en" : "english page"
...
}
```

If there is other better example, welcome for the feedback. Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.