Comments (3)
Hi there! This is true, and I will add that not all templates have been prepared for localization yet. You will encounter other pages that are missing calls to {{t.example_translation_key}}
and instead have hard-coded English.
I have (very) slowly been working on this. If you feel up to helping with this, here is an example of a commit that prepares one of the view templates for localization: 2c32bb8
Edit: Oops! I see you have already done this in your pull request. Thank you!!! 😄
from gollum.
but I have found that some pages do not have templates
The modal windows that you have taken screenshots of ("Create New Page", "Rename to") are built in JavaScript.
Because the JavaScript file is an ERB template (lib/gollum/public/gollum/javascript/gollum.js.erb
) we should be able to access the translation strings via the Precious::Views::LocaleHelpers#tt
method:
$.GollumDialog.init({
- title: 'Create New Page',
+ title: '<%= tt["insert"]["the"]["correct"]["nested"]["translation_key"] %>',
fields: [
{
id: 'name',
- name: 'Page Name',
+ name: '<%= tt["another"]["translation"]["key"] %>',
type: 'text',
defaultValue: '',
context: context_blurb
}
],
I haven't manually tested this change--it's possible that #tt
is not available from this file and we will have to reference it in its namespace or require LocaleHelpers
module explicitly.
from gollum.
Because the JavaScript file is an ERB template (
lib/gollum/public/gollum/javascript/gollum.js.erb
) we should be able to access the translation strings via thePrecious::Views::LocaleHelpers#tt
method:
To be honest, I don't know much about JavaScript. But I think if the text in the page is uniformly defined, we can make localized replacements.
from gollum.
Related Issues (20)
- Investigate server error reporting on save HOT 2
- Failed to install on Ubuntu 22.04 HOT 3
- Failed to run `java gollum.war` resulting in thread error HOT 3
- Ask a question
- Problems caused by language HOT 4
- Navigation macro does not recognize explicit false for sub_path HOT 2
- YAML frontmatter cannot have a folded scalar HOT 1
- git creates 'main' as default branch HOT 1
- Redirects to incorrect page when being served behind nginx proxy HOT 4
- Move from RACK_ENV to APP_ENV HOT 4
- Move from master to main as default branch HOT 4
- No API in `A simple, Git-powered wiki with a sweet API and local frontend. ` HOT 6
- Is there any solution we can integrate Apache Echarts in gollum wiki? HOT 3
- Unnecessary content in the overview page HOT 3
- we need to add a language list menu HOT 4
- Unable to create, delete, or rename directory HOT 1
- Sprockets::FileNotFound @primer/css/color-modes in development HOT 10
- redirect error when use base_path option HOT 2
- Edit button does not lead to editable content HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gollum.