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

Translation: Newer simplified Chinese #292

Open
Fomalhauthmj opened this issue Jan 16, 2022 · 12 comments · Fixed by #293
Open

Translation: Newer simplified Chinese #292

Fomalhauthmj opened this issue Jan 16, 2022 · 12 comments · Fixed by #293
Labels
A-translation Area: Everything regarding translations

Comments

@Fomalhauthmj
Copy link

In last two weeks, I read this book and did my best to translate it into a newer simplified Chinese translation.
Maybe we can add a translation list in readme for those who want read in native language?.🤔
The translation repo is here .

@simonsan simonsan changed the title A newer simplified Chinese translation of this book is available. Translation: Newer simplified Chinese Jan 16, 2022
@simonsan
Copy link
Collaborator

As long as mdbook doesn't support i18n we should probably create a new sections for 'translations' in SUMMARY.md and collect them there.

@simonsan simonsan added the C-addition Category: Adding new content, something that didn't exist in the repository before label Jan 16, 2022
@pickfire
Copy link
Contributor

pickfire commented Jan 16, 2022

@Fomalhauthmj I think can just use the usual approach when i18n is not support, put the translated link in README. Let me submit a pull request for this.

@simonsan simonsan added A-translation Area: Everything regarding translations and removed C-addition Category: Adding new content, something that didn't exist in the repository before labels Jan 17, 2022
@simonsan simonsan mentioned this issue Feb 17, 2023
@simonsan simonsan reopened this Apr 5, 2023
@simonsan
Copy link
Collaborator

simonsan commented Apr 5, 2023

Reopening: We are refactoring to a new translation system that should make it easier.

CC: #352 #345

@Fomalhauthmj Would you be able to adopt your translation when we are ready?

@Fomalhauthmj
Copy link
Author

Of course, I will review my translation again in the spare time for a better reading experience.

@simonsan
Copy link
Collaborator

simonsan commented Apr 5, 2023

It will probably still take some time until we can fully adopt it, as it seems like that Markdown formatting isn't transferred in the translation process. Afaiu that could destroy the ability to further translate things within a language, when we would reformat the original markdown.
So take you time, really.

Tracking: google/mdbook-i18n-helpers#19

@simonsan
Copy link
Collaborator

simonsan commented Apr 7, 2023

The translation system is merged 🚀 and translations are now supported in this repository.

Please read here how translations can be updated/added. If any further help is needed setting it up, please tag me.

@Fomalhauthmj
Copy link
Author

Ok, I have learned how to work with po files.When my translation being prepared, I will open a pr on main branch.

@simonsan
Copy link
Collaborator

simonsan commented Apr 7, 2023

Ok, I have learned how to work with po files.When my translation being prepared, I will open a pr on main branch.

I prepared some CI stuff already, so when your PR comes, we need to set it up for a first translation. It shouldn't be a lot of work, but please make sure maintainers can edit your branch so we can help setting up the very first translation. 👍🏽

@simonsan
Copy link
Collaborator

simonsan commented Apr 9, 2023

I'm working on a German translation in #359 so I will make the initial setup there. Within your PR for another language, we would only need to add stuff to the language picker and CI manually. 👍🏽

@Fomalhauthmj
Copy link
Author

@simonsan , I found that messages.pot file doesn't contain corresponding quote links, check this file, the following contents can't found in messages.pot.

[associated function]: https://doc.rust-lang.org/stable/book/ch05-03-method-syntax.html#associated-functions
[std-default]: https://doc.rust-lang.org/stable/std/default/trait.Default.html
[std-or-default]: https://doc.rust-lang.org/stable/std/?search=or_default
[API Guidelines/C-COMMON-TRAITS]: https://rust-lang.github.io/api-guidelines/interoperability.html#types-eagerly-implement-common-traits-c-common-traits

@simonsan
Copy link
Collaborator

Need to investigate that the next days. Thanks for bringing it up. It could be also related to markdown formatting in google/mdbook-i18n-helpers#19 so will also double check if that could be an upstream issue as well

@Fomalhauthmj
Copy link
Author

I have checked the process of create_catalog in mdbook-i18n-helpers, use following test function:

    fn my_test() -> anyhow::Result<()> {
        let (ctx, _tmp) = create_render_context(&[
            ("book.toml", "[book]"),
            ("src/SUMMARY.md", "- [The Foo Chapter](foo.md)"),
            (
                "src/foo.md",
                "this is a quota link [name1][ref1].\n\n[ref1]:test_url\n",
            ),
        ])?;

        let catalog = create_catalog(&ctx)?;

        for msg in catalog.messages() {
            assert!(!msg.is_translated());
        }
        Ok(())
    }

And,the events we got are:

Start(Paragraph) -- "this is a quota link [name1][ref1].\n"
Text(Borrowed("this is a quota link ")) -- "this is a quota link "
Start(Link(Reference, Borrowed("test_url"), Borrowed(""))) -- "[name1][ref1]"
Text(Borrowed("name1")) -- "name1"
End(Link(Reference, Borrowed("test_url"), Borrowed(""))) -- "[name1][ref1]"
Text(Borrowed(".")) -- "."
End(Paragraph) -- "this is a quota link [name1][ref1].\n"

It seems like that we need make sure that [ref1] shouldn't be translated for correct reference-style links. In this way, the reference-style links can work fine as usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Everything regarding translations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants