Code Monkey home page Code Monkey logo

Comments (5)

loominade avatar loominade commented on August 16, 2024 1

as a workaround, you can extend it and translate indiviual methods:

class AddToGermanHomeScreen extends window.AddToHomeScreen {
  _genTitle() {
    return this._genTitleWithMessage(
      `Installieren Sie die ${this.appName} App, um fortzufahren`,
    );
  }
  _safariAddToHomeScreenButtonDe() {
    return (
      'data:image/svg+xml;base64,' +
      btoa(`<svg xmlns="http://www.w3.org/2000/svg" width="161" height="30" fill="none">
              <path fill="#F5F5F5" d="M0 0h161v30H0z"/>
              <path fill="#000" d="M151.984 19.251a3.767 3.767 0 0 1-1.104 2.654A3.733 3.733 0 0 1 148.226 23l-9.482-.017a3.747 3.747 0 0 1-2.65-1.104A3.757 3.757 0 0 1 135 19.222l.016-9.473a3.767 3.767 0 0 1 1.104-2.654A3.733 3.733 0 0 1 138.774 6l9.482.017c.995.001 1.948.399 2.65 1.104A3.757 3.757 0 0 1 152 9.778l-.016 9.473Zm-1.225-9.3a2.686 2.686 0 0 0-.78-1.894 2.675 2.675 0 0 0-1.888-.787l-9.167-.016a2.667 2.667 0 0 0-2.472 1.648 2.685 2.685 0 0 0-.206 1.023l-.015 9.059a2.666 2.666 0 0 0 .779 1.894 2.676 2.676 0 0 0 1.889.787l9.166.016a2.676 2.676 0 0 0 2.473-1.648c.134-.324.204-.672.205-1.024l.016-9.058Z"/>
              <path fill="#000" d="M147.189 14.019h-7.056a.641.641 0 1 0 0 1.283h7.056a.642.642 0 0 0 0-1.283Z"/>
              <path fill="#000" d="M144.302 18.189v-7.057a.641.641 0 1 0-1.283 0v7.057a.641.641 0 1 0 1.283 0Z"/>
              <text xml:space="preserve" fill="#000" font-family="-apple-system, BlinkMacSystemFont, sans-serif" font-size="12" font-weight="500" letter-spacing="0em" style="white-space:pre"><tspan x="6.313" y="18.048">Zum Home-Bildschirm
            </tspan></text>
            </svg>
          `)
    );
  }
  _genIOSSafari(container) {
    var containerInnerHTML =
      this._genLogo() +
      this._genModalStart() +
      this._genTitle() +
      this._genListStart() +
      this._genListItem(
        '1',
        `Tippen Sie auf die 
          <img
            class="adhs-ios-safari-sharing-api-button"
            src="${this._genAssetUrl('ios-safari-sharing-api-button.svg')}"/>
          Schalt­fläche unten.`,
      ) +
      this._genListItem(
        '2',
        `Wählen Sie 
        <img
          class="adhs-ios-safari-add-to-home-screen-button"
          src="${this._safariAddToHomeScreenButtonDe()}"
        />
        aus dem Menü, das sich öffnet.
        <span class="adhs-emphasis">
          Möglicher­weise müssen Sie nach unten scrollen, um diesen Menüpunkt zu finden.
        </span>`,
      ) +
      this._genListItem(
        '3',
        `Öffnen Sie die <img class="adhs-your-app-icon" src="${this.appIconUrl}"/> app.`,
      ) +
      this._genListEnd() +
      this._genModalEnd() +
      `<div class="adhs-ios-safari-bouncing-arrow-container">
      <img src="${this._genAssetUrl('ios-safari-bouncing-arrow.svg')}" alt="arrow" />
    </div>`;
    container.innerHTML = containerInnerHTML;
    container.classList.add('adhs-ios');
    container.classList.add('adhs-safari');
  }
}

from add-to-homescreen.

jpjust avatar jpjust commented on August 16, 2024 1

The project now supports multi-language through i18n. Just take a look at src/locales folder and you will find some translation files. Just make a copy of one of them and translate the strings to Spanish and then add your new locale in src/index.js.

Create a pull request so the maintainer will push it into the original code.

from add-to-homescreen.

philfung avatar philfung commented on August 16, 2024

Which languages are you specifically looking for?

from add-to-homescreen.

devmilitia avatar devmilitia commented on August 16, 2024

I look for spanish language partner

from add-to-homescreen.

devmilitia avatar devmilitia commented on August 16, 2024

I edit the assets to spanish language, and the JS file.
share with US in: https://drive.google.com/drive/folders/1jWfTnk0WIWt_KE0McGjNp2iojZ-0Rp5D?usp=sharing

from add-to-homescreen.

Related Issues (16)

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.