URL format to open file in editor

I’m trying to make a button on my website to “Localise this file on Crowdin”, which would open the file in the editor.

I’m looking for the URL format, something like:
crowdin.com/localise/my-project/lang/path/to/file

I have access to the locale and to the relative path from root

I just realised the locale format on Crowdin is different to fr_FR: that becomes fr. What’s the pattern?

Hi @its_miroma

What website builder solution are you using? We have pre-made integrations for all popular website constructors.

Do you want to build your connector using an API? If so, I’m not sure I got your point with the URL right. Can you please provide some extra context? Do you see any errors or struggles at some point?

As for codes, fr-FR would be a local, while fr is a 2-letter variant.

We’re building the website with VitePress. The website is open source at https://github.com/FabricMC/fabric-docs.
The idea is to show the “Localise on Crowdin” button on every 404 page, and possibly a “See anything wrong?” button on other pages.

No, I want to do something similar to the “Edit this page on GitHub” button, which links to https://github.com/FabricMC/fabric-docs/edit/main/:path.
I’m looking for a url like that, if possible.

For example, on the page /path/to/file, the url for GitHub becomes https://github.com/FabricMC/fabric-docs/edit/main/path/to/file.

Hello,

To achieve similar functionality to the “Edit this page on GitHub” button for your VitePress website, you can construct a URL that will direct users to the Crowdin project for the specific file they are viewing.

While we don’t have a custom URL builder, you can use a structure similar to the one provided for GitHub, but with the Crowdin project URL.

Each file has a unique identification marker, for example, here are some test files in my project, and if you open them in Editor, the URL would be next:


Understood, but how can I obtain the unique identification marker?

It can be retrieved with API. But I assume it would be a very time-consuming process to build the integration you have in mind.

How about trying JS Proxy instead? I’ve also noticed that Vite Press is quite similar to Vue Press, maybe recommendations for Vue Press will work for you as well?

1 Like

I’ve settled on opening the editor for the language, not specifically for the file. Will take a look at your suggestion later, though, thank you!