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

svelte: Update usageMatchRegex #826

Merged
merged 5 commits into from Aug 27, 2023
Merged

svelte: Update usageMatchRegex #826

merged 5 commits into from Aug 27, 2023

Conversation

ZerdoX-x
Copy link
Contributor

@ZerdoX-x ZerdoX-x commented Oct 28, 2022

This PR:

  1. Fixes Inline annotation does not work if t function contains a newline #132 for svelte
  2. Adds format next to _ and t as it's for example exported in the most popular at the moment i18n library for svelte
  3. Adds one more svelte-specific way to handle store. (not by subscribing store via $, but using get function from svelte). get(_) use case may appear when you are trying to get translation outside of svelte component where you can't automatically subscribe with $

UPD: initial proposed regex was invalid. see #1001 and #1013

@ZerdoX-x
Copy link
Contributor Author

though i didn't check other frameworks if they have this issue

maybe we need a test for each framework's regexs? to check if they support linebreaks

@ZerdoX-x ZerdoX-x changed the title fix: issue #132 for svelte svelte: Update usageMatchRegex Oct 28, 2022
@ZerdoX-x
Copy link
Contributor Author

@terales Hi! It's been a while. Could you please take a look at this one?

@terales terales merged commit 5ba4582 into lokalise:main Aug 27, 2023
3 checks passed
@ZerdoX-x ZerdoX-x deleted the patch-1 branch August 27, 2023 23:24
huacnlee pushed a commit to huacnlee/i18n-ally that referenced this pull request Aug 28, 2023
* fix: issue lokalise#132 for svelte

* add `get()` support

* replace .* with {key}

* add support for spaces & line breaks in get()

* Empty commit to trigger CI

---------

Co-authored-by: Alex Terehov <terales@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Inline annotation does not work if t function contains a newline
2 participants