question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add support for custom language mapping to hard-coded string extraction

See original GitHub issue

Describe the solution you’d like: Would like to have an config option to map .svelte files to the html parser of hard-coded string extraction, it should work with no issue since they are just html files with <script> & <style> tags, which can be excluded already

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
alexanderniebuhrcommented, Jul 14, 2021

I will open any findings in a new issue. Nevermind about the extracted strings, can’t reproduce it anymore.

1reaction
alexanderniebuhrcommented, Jul 14, 2021

Not having a public one for now (working on one in private repo), can attach it later this week, since it is going public by then. However, a Svelte file with internationalization would look similar like

<script>
  import { _ as t } from 'svelte-i18n'
</script>

<div>
  <f-button class="bg-light-300" on:click={(e) => handle365Login(e)}>
    {$t('page.login.ms365')}
  </f-button>
  <f-button class="bg-light-300" on:click={(e) => handle365Logout(e)}>
    {$t('page.logout.ms365')}
  </f-button>
  <f-button class="bg-light-300" on:click={(e) => handle365Logout(e)}>
    Text to extract
  </f-button>
</div>

<style>

</style>

this is an example by svelte-i18n

<script>
  import { _ } from 'svelte-i18n'
</script>

<h1>{$_('page.home.title')}</h1>

<nav>
  <a>{$_('page.home.nav', { default: 'Home' })}</a>
  <a>{$_('page.about.nav', { default: 'About' })}</a>
  <a>{$_('page.contact.nav', { default: 'Contact' })}</a>
</nav>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Hard-coded string literals | IntelliJ IDEA Documentation
IntelliJ IDEA provides a special intention action i18nize hard coded string literal to extract string literals into your properties files. You ...
Read more >
Vue templates internationalization
Configure hardcoded strings extraction from Vue templates ... You can add custom attributes, like data-content , by appending a new attribute to the ......
Read more >
Localize your app - Android Developers
Managing strings for localization · Move all strings into strings.xml · Follow Android guidelines for UI strings · Provide sufficient context for ...
Read more >
c# - Using a lot of hardcoded strings in code - Stack Overflow
This has nothing to do with the language, simply hard coded string values in source code. As a statically typed, compiled language, any ......
Read more >
[EPIC] Automatic hardcoded strings extraction from Vue (vue ...
Initially suggested at #164 Progress: Create a set of rules for detecting a natural language and skip false positives #485 ✓ Detect ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found