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

Picture links get changed by translation #10

Open
Basti504 opened this issue Aug 8, 2023 · 4 comments
Open

Picture links get changed by translation #10

Basti504 opened this issue Aug 8, 2023 · 4 comments

Comments

@Basti504
Copy link

Basti504 commented Aug 8, 2023

Hi,

Thanks for this great plugin, I started to translate my wiki. But one thing is holding me back, all image links are changed, causing them to no longer be displayed untill I manually edit them.

In the origional page the image links is as follows: {{ ::applicatieoverzicht.png?nolink |}}
After translation is becomes this: {{ applicatieoverzicht.png?nolink |}}.
The :: in the link disappear, then they do not longer work.

Is there a way to prevent this from happening?

@NetaliDev
Copy link
Owner

The plugin normalizes all links and converts them into absolute paths so that the original images can be displayed on the translated page. This is done by using the builtin link functions in DokuWiki, but I've never seen the link-syntax you use before. Should this be a relative link to a image in the same namespace of the wiki page? Then the correct syntax would be {{ .:applicatieoverzicht.png?nolink |}} and this should be substituted with a absolute link after the translation.

The DokuWiki link syntax is explained here: https://www.dokuwiki.org/namespaces#creating_namespaces

@Basti504
Copy link
Author

Basti504 commented Aug 8, 2023

Ok, I understand why the images do not load.

All images are in the root namespace, the translated pages should keep using the origional images. As I understand now the image does not load because {{ applicatieoverzicht.png?nolink |}} used in the en:test page is searching the image in the en namespace, while the image is not their. Good to know if in the future I want to provide translated images.

However, when I make a test page with the following syntax.

page name is: test (in root namespace)
Hallo, dit is een test
{{ .:actions1.png?nolink |}}
{{ ::actions2.png?nolink |}}
{{ actions3.png?nolink |}}
{{ .:actions4.png?nolink |}}
The actions3.png loads because the page is also in the root namespace, and therefore relatively correct.

The result I get for the translated page: en:test

Hello, this is a test
{{ actions1.png?nolink |}}
{{ actions2.png?nolink |}}
{{ actions3.png?nolink |}}
{{ actions4.png?nolink |}}

All images do not load anymore. It looks like the images are now made relative to the current en namespace, instead of the fixed root namespace :

@NetaliDev
Copy link
Owner

You can use {{ :actions1.png?nolink |}} to reference a image in the root-namespace and this should work.

@Basti504
Copy link
Author

Basti504 commented Aug 8, 2023

Thanks.

Page test
Hallo, dit is een test
{{ :actions5.png?nolink |}}

Unfortunately that also gets converted to a relative image.

Page en:test
Hello, this is a test
{{ actions5.png?nolink |}}

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

2 participants