-
Hey there, I have an interesting question for users who use the Cyrillic alphabet for their blog. We have already discussed how to make a multilingual blog. A brunch "demo/translate" with a solution based on "next-translate" as an example present. But in the multilingual blog and the monolingual site example, using Cyrillic has the following problem with "tags". We will see the tag's name in the target language for tags in the address bar. And in the case of using Cyrillic as the blog's language, we will see Cyrillic in the address bar. For example, if we will use as a tag "Дом" for a post, then in the address bar, we will see like localhost:300/tags/дом. It is not suitable for search engines. In this case, it would be good to use the automatic converting of Cyrillic to Latin transcriptions. I tried integrating this solution "cyrilic-to-translit-js". If I add the following code to the file
Then in the address bar, I will see the following localhost:300/tags/dom. But in this case, the page has a 404... Perhaps a similar upgrade should be done in the following file Can anyone help me with this question? Perhaps it would be useful to other users who use Cyrillic. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think the best way would probably be to use rewrites. It would look something like this:
The downside is that you would have to do this manually for each tag that you think needs to be converted. An alternative approach would be to use middleware. With this, you could run |
Beta Was this translation helpful? Give feedback.
I think the best way would probably be to use rewrites. It would look something like this:
The downside is that you would have to do this manually for each tag that you think needs to be converted.
An alternative approach would be to use middleware. With this, you could run
CyrillicToTranslit
on all paths coming from/ru/tags
and redirect them. The downside is that you have to deploy it with the next.js server or on vercel. Have not actually tried the middleware feature myself, so I can't provide more advise beyond …