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 path to TranslatedContent #863

Merged
merged 2 commits into from
Dec 6, 2019
Merged

Conversation

phil-opp
Copy link
Contributor

This makes it possible to retrieve the translated page through the get_page function.

Fixes #859

components/library/src/content/ser.rs Outdated Show resolved Hide resolved
This makes it possible to retrieve the translated page through the `get_page` function.
@phil-opp phil-opp force-pushed the translations-file-path branch from 9488b92 to 9521594 Compare November 29, 2019 09:55
@phil-opp phil-opp changed the title Add file_path to TranslatedContent Add path to TranslatedContent Nov 29, 2019
@Keats
Copy link
Collaborator

Keats commented Nov 29, 2019

Just for sanity check, did you test it locally to ensure it does what you need? I think we could add a call to get_page in https://github.com/getzola/zola/blob/master/test_site_i18n/templates/page.html and check it in the components/sites/tests/i18n files since there is no other easy to test it.
I should have mentioned the first time around, sorry :(

Use it with the `get_page` function to get a reference to the page object.
@phil-opp
Copy link
Contributor Author

phil-opp commented Dec 2, 2019

Yes, I tested it locally.

I think we could add a call to get_page in https://github.com/getzola/zola/blob/master/test_site_i18n/templates/page.html and check it in the components/sites/tests/i18n files since there is no other easy to test it.

Done!

I should have mentioned the first time around, sorry :(

No worries! It's definitely a good idea to add a test for this.

@Keats Keats merged commit f7955e4 into getzola:next Dec 6, 2019
@Keats
Copy link
Collaborator

Keats commented Dec 6, 2019

Thanks!

@phil-opp phil-opp deleted the translations-file-path branch December 19, 2019 12:23
Keats pushed a commit that referenced this pull request Feb 3, 2020
* Add path to `TranslatedContent`

This makes it possible to retrieve the translated page through the `get_page` function.

* Use TranslatedContent::path field in test_site_i18n

Use it with the `get_page` function to get a reference to the page object.
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