scossin / ontodia-blazegraph-docker

A docker-compose to deploy blazegraph and ontodia
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Change Language in Ontodia interface #3

Open scossin opened 2 years ago

scossin commented 2 years ago

Default languages in Ontodia are English and Russian: https://github.com/metaphacts/ontodia/blob/master/src/ontodia/workspace/workspace.ts

The code is bundled with webpack to create the file bundle.js which is sent to the browser. I wanted to change Russian by French. To change it at run-time, you can execute the following command :

docker exec ontodia /bin/sed -i "s/'ru', label: 'Russian'/'fr', label: 'French'/g" /ontodia-typescript-example/dist/bundle.js

It replaces the Russian language by the French language in the Interface. RDF statement like "something rdfs:label 'label'@fr" are displayed in the interface.

scossin commented 2 years ago

Useful command to see the context of the Russian language appearing in the bundle.js file:

grep -A2 -P '.{0,200}Russian.{0,200}' bundle.js

To change default language:

docker exec ontodia /bin/sed -i "s/language: 'en',/language: 'fr',/g" /ontodia-typescript-example/dist/bundle.js