Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website localization, or even folders 'diagnostics' #17

Open
SergeyZhurikhin opened this issue Dec 14, 2015 · 8 comments
Open

Website localization, or even folders 'diagnostics' #17

SergeyZhurikhin opened this issue Dec 14, 2015 · 8 comments

Comments

@SergeyZhurikhin
Copy link

What are the proposals for the organization of links to localized pages.
For example:
code-cracker.github.io/en/diagnostics - for English
code-cracker.github.io/ru/diagnostics - for Russian language.
Then it is necessary to alter the method:

public static class HelpLink
{
    public static string ForDiagnostic(DiagnosticId diagnosticId) =>
        $"https://code-cracker.github.io/diagnostics/{diagnosticId.ToDiagnosticId()}.html";
}

Like that:

public static string ForDiagnostic(DiagnosticId diagnosticId)
{
    return $"https://code-cracker.github.io/diagnostics/{CultureInfo.CurrentCulture.Parent.Name}/{diagnosticId.ToDiagnosticId()}.html";
}
@carloscds
Copy link
Contributor

@SergeyZhurikhin It's a good point. Do you have interest in translate documentation for Russian ?

@giggio
Copy link
Member

giggio commented Dec 14, 2015

I like it!

@SergeyZhurikhin
Copy link
Author

Yes, in addition to high-quality translation of resource strings in any case have to go to each page of the document and make sure that I understand the line resource.
If there are no objections, I will do so

code-cracker.github.io/en/diagnostics - for English
code-cracker.github.io/ru/diagnostics - for Russian language.
code-cracker.github.io/diagnostics - apparently, for some time, this folder will remain, since the new version does not directly flow into the user's computer. After some piece time to remove it.

In tandem with this change, I change HelpLink.

@giggio
Copy link
Member

giggio commented Dec 14, 2015

@SergeyZhurikhin Before we do that, it would be nice to have a fallback to English. If a diagnostic page does not exist for Russian, for example, it would be nice to be able to show the English one. How would we do that?

@SergeyZhurikhin
Copy link
Author

@giggio In the first stage, I would like to copy all pages from diagnostics to ru/diagnostics, and leisurely to translate into Russian. Thus the page in any case, will be available.

And if you ask when there are no pages like this: http://code-cracker.github.io/diagnostics/CC0095.html
http://code-cracker.github.io/diagnostics/CC0105.html
There will have to create the page, and may create a console application - synchronizer, that checks the pages and the rules in the code.

@giggio
Copy link
Member

giggio commented Dec 15, 2015

Ok, it makes sense that you start translating to ru. You can go ahead and start translating them, and sending the PRs.

To solve the problem, we could keep sending the user to /, and sniff the browser language (the Accept-Language header) and automatically redirect them to /ru if it is the case. How about that?

More on that: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4

I don't know how we would do that with Jekyll and Github pages, or maybe using JavaScript. It would be a good idea to research that.

@SergeyZhurikhin
Copy link
Author

@giggio We can experiment with redirect.

@giggio
Copy link
Member

giggio commented Dec 15, 2015

Yeah, but I don't know if we can do that. We will have to look it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants