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

Initial translation mechanism setup #13

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

thepabloaguilar
Copy link

@thepabloaguilar thepabloaguilar commented Feb 19, 2024

This PR introduces the initial translation setup, instead of adding a new language to test my plan is to change how the Russian is built today (but keeping it as the source of truth). Here we have the automation to render schemas from the schema resources. So far I've just changed the way of one line from ru/schema-sources/atack1.drawio is rendered so we can discuss more before modifying everything at once!

Related #12

@thepabloaguilar
Copy link
Author

@sobolevn I guess you'll need to activate the GitHub Actions for this repo so we can test it!

@thepabloaguilar thepabloaguilar force-pushed the issue-12-initial branch 10 times, most recently from 7b2aa67 to ef8be76 Compare February 19, 2024 02:26
@thepabloaguilar
Copy link
Author

I've tested using my fork, it seems to be working: https://github.com/thepabloaguilar/ship-it-boardgame/actions/runs/7953725735

Copy link
Owner

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you, looks simple enough!

Why image sizes were changed?

ru/schema-sources/atack1.drawio Outdated Show resolved Hide resolved
@thepabloaguilar
Copy link
Author

About the image size change I don't know, maybe when you're exporting those you're embeeding the DrawIO Diagram into the images?

ru/schemas-info.yml Outdated Show resolved Hide resolved
ru/schemas-info.yml Outdated Show resolved Hide resolved
ru/schemas-info.yml Outdated Show resolved Hide resolved
ru/schemas-info.yml Outdated Show resolved Hide resolved
attack:
first_player_hand: Рука Алисы
first_player_table: Стол Алисы
second_player_hand: Рука Бориса
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've missed Стол Бориса

Copy link
Author

@thepabloaguilar thepabloaguilar Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 'cause attack doesn't show any table for Boris

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can reuse game_process: here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can but we should have another name for the yaml section for that 🤔

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look: the grid is gone for some reason 🤔
And the right padding

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess the padding can be configurable but I'm not sure about the grid! I'm using this exporter https://github.com/jgraph/draw-image-export2

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

padding is optional, but the grid is hard required :(
It is a part of the styleguide.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna open an issue there to see if there's a parameter to pass!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sobolevn, I'm back here! I've tried to explore how things work but no success 😞

And no one answered the issue

logger = logging.getLogger(__name__)

# Add your language folder below when it's ready to be rendered
LANGUAGE_FOLDERS: Final = {'ru'}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LANGUAGE_FOLDERS: Final = {'ru'}
LANGUAGE_FOLDERS: Final = frozenset({'ru'})

json={'format': 'jpg', 'xml': rendered},
stream=True,
)
assert response.status_code == 200, response.text
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert response.status_code == 200, response.text
response.raise_for_status()

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this file to tools/
and name it render-diagram.py

name: Защита
types:
certificate: Сертификат
escape: Отговорка
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excuse

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

Successfully merging this pull request may close these issues.

2 participants