Giter Site home page Giter Site logo

We need more templates about gollum HOT 3 OPEN

zoumingzhe avatar zoumingzhe commented on May 25, 2024
We need more templates

from gollum.

Comments (3)

benjaminwil avatar benjaminwil commented on May 25, 2024

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.

benjaminwil avatar benjaminwil commented on May 25, 2024

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.

zoumingzhe avatar zoumingzhe commented on May 25, 2024

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:

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)

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.