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

add translation #991

Open
4 tasks
Udarthegreat opened this issue Jan 31, 2022 · 5 comments
Open
4 tasks

add translation #991

Udarthegreat opened this issue Jan 31, 2022 · 5 comments
Labels
Discussion This is open for a discussion. GitBook This is GitBook related.

Comments

@Udarthegreat
Copy link

Udarthegreat commented Jan 31, 2022

Feature Request

Description

One of the highest barriers to entry for any project is an inability to understand the language of the source material or in the case of websites to have to deal with translation Brouwer plugins that can be rather hit or miss with translation. Though, out of the gate, I am aware that adding translation to chapters can be more complicated then other possible additions, in my head this is more of a nice to see some day and of no urgent importance. I am aware that approving translations to chapters would be significantly harder due to the small size of the community so a competitively small amount of languages would be approved by trusted members of the community, and even then reviewing a translation would take more time then a chapter or new implementation for an existing chapter. Though this can be partially fixed by adding a translations.md (or some other similar name) with all the languages that the community can cover and making it explicitly clear that translations out of that list of lang's are unlikely to be merged until someone with knowledge of the lang can take responsibility and becomes a trusted member of the community.

Now that that is out of the way, how might this be implemented. This I will split it into two sections how the UI may work and how the actual translations would work.

UI concept

This is not that complicated, I propose that we add another drop down with translations such as the implementation switcher that would allow one to switch between translations. Below I have attached a concept image I created for how this may look, the dimensions are not 100% accurate to the AAA this is just for conversations, if needed I could make these more accurate to how it looks on AAA (I'm really new to creating concepts such as these) (also as a note these were generated using Affinity Designer, I could, if needed drop the latest version of affinity designer file in also):

AAA translation concept

(I tried to make the image smaller by putting it in a table but when I did so it disappeared for some reason) (also I did not mention previously but I think its fairly obvious this is with the light theme, because all that would be necessary to switch to a different theme would be to change colors and that is trivial) (also the text in the drop down was based on responses to my comment below)

implementation concept

Off of the top of my head there are several ways this could be achieved, some easier then others though the easier ones would likely take up more space in the repo and be less efficient. Also as mentioned below this really does depend upon what is decided in issue 611 because depending on what is chosen there may be default ways to achieve this with the site generator chosen.

01 rewrite

The first option I can think of is completely rewrite the page in a new file in the new translation language and link them together in the main English translation or in some other JSON, YAML etc. file. This would theoretically be the simplest for potential contributors but may require the most new code for the generation of the site and is definitely the least space efficient taking up most space. (Or there can be a different URL for each translation though that would require generating allot of new URLs though it would require less extra site generation code)

02 POT file based

The second option I can think of is to utilize pot and po files to store translations were each paragraph/ individual piece of separate text is a separate msgid and thus can be translated in a msgstr. As an example of this below I have a code snippet of the first paragraph of the intro translated to Romanian since that is the only language other then English I am comfortable in

msgid "The Arcane Algorithm Archive is a collaborative effort to create a guide for all important algorithms in all languages. This goal is obviously too ambitious for a book of any size, but it is a great project to learn from and work on and will hopefully become an incredible resource for programmers in the future."
msgstr "Arcane Algorithm Archive este un efort de colaborare pentru a crea un ghid în toate limbile pentru toți algoritmii importanți. Acest obiectiv evident este prea ambițios pentru o carte de orce dimensiune, dar este un proiect  minunat din care se poate învăța și pe care se poate lucra, în speranța ca  să fie o resursa pentru programatori in viitor"

A few other notes on this method that I would like to point out. For some languages it may be necessary to change were example code and mathematical formulas are at in a page then in english which would be a non trivial matter with this method from what I can tell. It would also be best for items within a table to be separate msgid's since that would, from what I can tell make it easier on someone looking to translate a particular page. As for translated plots, when necessary, the msgid would be the uri to the original image and the msgstr would be the link to the translated image.
~

Additional context

As a side note when I new chapter is added it would not require new translation files to be added because English could be the default and thus assumed, this would be added as a separate pull request when someone wants to add a new lang or just to add the basic infrastructure without adding any translations. This is also in the first paragraph "The Arcane Algorithm Archive is a collaborative effort to create a guide for all important algorithms in all languages". Also if a better method exists for web pages such as this, please comment on this because it relatively new to localization my self and am by no means an expert of any sort. Also as a side note I don't know which lang's the font used supports, if a language that is not supported by the font is added this may lead to some issues so some consideration may need to go into that before a pull request is merged for that.

Also I'm putting this up because I have not seen any others, so if there is a consensus or and existent pull request I understand if this is closed and if so please link me to that so I can gain context. Also if there is an existent plugin or something similar that has its own conventions I would appreciate if a link would be provided since I am not aware of any as of writing this. Since as I'm posting this as leios is live I was going to add a section for honkit translations but since that may not be around for much longer I'm going to leave that out, also I'm going to edit this with images for the UI concept which I still have to do.

I also just noticed this though this is significantly more thorough so I'll post it as is.

For Algorithm Archive Developers

  • This feature can be added to the Master Overview
  • There is a timeline for when this feature can be implemented (theoretically there is)
  • The feature has been added to the Master Overview
  • The feature has been implemented (Please link the PR)
@Udarthegreat Udarthegreat changed the title add syntax highlighting add translation highlighting Jan 31, 2022
@Udarthegreat Udarthegreat changed the title add translation highlighting add translation Jan 31, 2022
@leios leios added Discussion This is open for a discussion. GitBook This is GitBook related. labels Jan 31, 2022
@Udarthegreat
Copy link
Author

Udarthegreat commented Feb 1, 2022

as a follow-up question to this from the post above:

Also as a side note I don't know which lang's the font used supports, if a language that is not supported by the font is added this may lead to some issues so some consideration may need to go into that before a pull request is merged for that.

what font is used by the AAA and what Lang's are supported by it

@Amaras
Copy link
Member

Amaras commented Feb 1, 2022

We have two different fonts: a Serif one and a Sans one.
I don't remember which ones exactly, although that was explored on stream maybe not this time, but rather the previous one.

EDIT: sorry for the close, that was a misclick mistake on my part

@Amaras Amaras closed this as completed Feb 1, 2022
@Amaras Amaras reopened this Feb 1, 2022
@Udarthegreat
Copy link
Author

Udarthegreat commented Feb 10, 2022

A small question for the community on this issue. Before I pose the question, a bit of context is necessary. I am working on some concept graphics for the main post at the top but ran into a small issue I am not certain about. So question is as follows, should the names of the lang's in the translation drop down be in English or the translated lang, I have seen it done either way (or should the text in the drop down change with the selected lang)

Ex.

Spanish
Español
For Spanish
And

Romanian
Română
For Romanian
I would be gland you clarify any information

@leios
Copy link
Member

leios commented Feb 10, 2022

Is it possible to do both? Like Español (Spanish)

@Udarthegreat
Copy link
Author

Udarthegreat commented Feb 10, 2022

Is it possible to do both? Like Español (Spanish)

Yes (a method for translation has not been chosen (from what I can tell) and there is the ability to customize on the AAA's end if need be, this more of a question for me so that I can know what text to put in the concepts that I'm making) but then it would be likely that we would not be able to fit more then 1 translation per row

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion This is open for a discussion. GitBook This is GitBook related.
Projects
None yet
Development

No branches or pull requests

3 participants