Giter Site home page Giter Site logo

Comments (5)

use-strict avatar use-strict commented on August 29, 2024

You can customize the translations if you build from source. You will need to edit the files under src/app/translation, before the npm run build step.

from ethereum-lite-explorer.

deantheiceman avatar deantheiceman commented on August 29, 2024

This translation doesn't seem to be available, does src/app/translation overwrite the component translations?

Ethereum Lite Explorer
An open source Ethereum block explorer. Available on GitHub

from ethereum-lite-explorer.

use-strict avatar use-strict commented on August 29, 2024

I see the problem. There is no easy way of changing those texts. As they are defined in one of the core plugins, you don't have direct access to them. So, until we make a proper fix, there are some things you could do right now:

The easy and ugly fix: directly editing the generated files under dist/plugins/aleth.io/eth-lite/js. You'll have to manually find the bundle that contains the translations and change them in place. :(

There's also a slightly cleaner solution, but it's rather tedious for a simple text change. You could create a plugin that reimplements the page://aleth.io/dashboard object. You can start by reading the tutorial in the Alethio/cms repo readme. and then you could create a plugin that exports the new implementation of that object. You replace the page in the explorer's config with your own. I can provide more detailed steps if you want to go this way. Or you can join our Discord

On the long run, we should also fix this properly on our side. We have a few possible options:

a. Have a way of overriding specific plugin translations from the main app translation files. This would still require forking the project and rebuilding. Not ideal
b. Load the translations at runtime from JSONs instead of relying on Webpack, so that we can mount a custom file instead / overwrite the files. This would allow overriding specific translations without having to rebuild anything and it would work in both Docker-based and build-from-source setups. This would however mean that we treat the translations as data files and so we'd need a versioning scheme for them.
c. Provide translation overrides via the main config JSON file. We would add a new key per plugin, which will contain an object with translation overrides. The CMS will load those translation keys and overwrite the default values.
d. (specific fix) Just move the title and subtitle into a separate module instead of hardcoding them in the page object. This way we can override the texts by replacing the module with a custom implementation, instead of cloning the whole page layout.

from ethereum-lite-explorer.

use-strict avatar use-strict commented on August 29, 2024

Fixed. See https://github.com/Alethio/ethereum-lite-explorer#override-specific-text-strings-translations for instructions.

As per linked PR, option c) from above post was implemented.

from ethereum-lite-explorer.

use-strict avatar use-strict commented on August 29, 2024

Also make sure to npm install after git pull. Some dependencies were updated.

from ethereum-lite-explorer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.