Giter Club home page Giter Club logo

i18n-html_extractor's Introduction

hello hello hello

🦈 About Me

:octocat: Currently a Sr. Software Engineer at GitHub
🇰🇷 I was born in Seoul, and currently live in Chicago  Chicago flag
trans meow I'm trans, non-binary, and use they/them pronouns.
📫 How to reach me: email is best
Fun fact: I like sharks.

🎮 Playing

🏋️ Lifting

{
  "squats": 205,
  "bench": 185,
  "shoulder": 105,
  "deadlift": 195
}

🎧 Listening To

spotify-github-profile

i18n-html_extractor's People

Contributors

jamieshark avatar mrchrisw avatar progm avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

francisfuzz

i18n-html_extractor's Issues

Handle strings that have interpolation

There are strings where we might be rendering a string as a variable. Since gettext has way of handling interpolation as string arguments, we need to wrap the string and replace the arguments accordingly.

# Before extraction
<div>
   You submitted <%= count %> times!
</div>

# After extraction
<div>
   <%= "You submitted %{count} times!", count: count %>
</div>

Write tests for all expected matches

Each matcher should have a corresponding test to confirm that we are extracting the correct string.

# input.html
<div>
   <h1>Hello, World!</h1>
   <img alt="some picture" />
   <input placeholder="Enter your name">
   <button aria-label="Submit">Submit</button>
   You submitted <%= count %> times!
</div>

# output.html
<div>
   <h1>_('Hello, World!')</h1>
   <img alt="<%= _('some picture') %>" />
   <input placeholder="<%= _('Enter your name') %>">
   <button aria-label="<%= _('Submit') %>">_('Submit')</button>
   <%= "You submitted %{count} times!", count: count %>
</div>

Identify additional HTML attributes and formats that require translation

Example:

<div
    aria-label="<%= pluralize @entity.stargazer_count, "user" %> starred this repository"
    data-singular-suffix="user starred this repository"
    data-plural-suffix="users starred this repository"
>
  <%= render text_wrapper do %>
    <% if show_list_menu? %>Starred<% else %>Unstar<% end %>
  <% end %>
</div>

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.