Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap replacement value with {} in Svelte SFC #629

Closed
alexanderniebuhr opened this issue Jul 17, 2021 · 2 comments
Closed

Wrap replacement value with {} in Svelte SFC #629

alexanderniebuhr opened this issue Jul 17, 2021 · 2 comments

Comments

@alexanderniebuhr
Copy link
Contributor

Currently using the Extract text into i18n messages, offers to three replacements Values.
One of them is $t("KEY"), however if you have a Text in SFC in Svelte and want to replace it with a Variable, you need to wrap it in curly brackets {}

My suggestion is, to add this variant to the replacement Values list.
Code with one correct replaced Value, and one Text not replaced yet.

<script>
  import { t } from "svelte-i18n";
</script>

<div class="min-h-100vh flex flex-col">
  <header class="flex flex-row place-content-center p-4">
    <div class="flex flex-row gap-2">

      <a href="/news" use:link>
        <f-button>
          {$t("layout.default.news")}
        </f-button>
      </a>
      <f-button on:click={(e) => handle365Logout(e)}>
        LOGOUT
      </f-button>
    </div>
  </header>

</div>
@antfu
Copy link
Contributor

antfu commented Aug 11, 2021

Not sure if I got you, can you provide some example to explain further? Thanks

@alexanderniebuhr
Copy link
Contributor Author

For these values from the extraction command it would be great for svelte if there are additional entries wrapped with
{ <REPLACEMENT> }

Screenshot 2021-08-11 at 10 13 17

@antfu antfu added this to the Weekly cycle 024 milestone Aug 11, 2021
@antfu antfu closed this as completed in 8940cc2 Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants