How to translate Portal

Hello,

I’ve been wanting a localized version of the Portal for a while, as I think it is friendlier for potential new subscribers to be greeted in their language. Does anyone know of any collaborative projects to that effect?

In the meantime, I’ve downloaded the source code from GitHub - TryGhost/Portal: Drop-in script to add membership features in a Ghost theme and played around with translating the relevant parts into French. Now I have an updated .zip file with (I think) most of the translation done, but how would I use it to replace the existing portal?

I’m self-hosting with the Cloudron app, but I can manage with a general hint of where to look.

Thank you!

UPDATE: I’ve followed the instructions posted here How to modify and load the portal directly from your theme , but after editing config.production.json, the portal doesn’t load. I tried even using the original portal file from https://unpkg.com/@tryghost/portal@~1.12.0/umd/portal.min.js and uploading it into my theme, to make sure it wasn’t a mistake I’d introduced into the file, and it’s the same. So I guess, now, notwithstanding any changes/translations I may add to the portal.min.js file, my question is how to get the portal to load from editing config.production.json.

Otherwise, if there is a way to edit defaults.json directly to point to the new url, that would be great, but I guess the read-only filesystem (of Cloudron install) would prevent that?

If I am not mistaken, you get to load from current/core/shared/config and, in the defaults.json you change the path in

        "url": "URL",
        "version": "2.14"
    }

Thanks, I’ve tried but had no success with that.

FYI we now have a community project plan for implementing translations properly, just in case either of you are interested :slight_smile:

1 Like

That’s a really good idea! I could only contribute translation, though.

I succeeded in loading portal.min.js from my own theme / server - but tiers are not loading as configured in the admin section of ghost. Only the free tier is available after loading the portal from my self-hosted server. Any ideas if there have to be changes made someplace else than portal.min.js to adjust portal translations?

That’s odd. Any errors in the console F12 when you load the page?

Will check tomorrow. Thanks for your interest!

@Cathy_Sarisky Found the problem: my site was set to private, so portal.min.js could not be loaded. Thanks for the hint!

1 Like

laughing - I hit a similar problem with a site last night. I’d logged in as an admin and couldn’t for the life of me figure out why the rss feeds weren’t working. Forgot the client had the site private.

15 minutes of my life I’m not getting back.