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

XLIFF export considering #bc-ignore! #195

Open
futuretap opened this issue Jul 20, 2020 · 2 comments
Open

XLIFF export considering #bc-ignore! #195

futuretap opened this issue Jul 20, 2020 · 2 comments

Comments

@futuretap
Copy link

futuretap commented Jul 20, 2020

Problem Statement

Xcode's builtin "Export for Localization…" XLIFF export includes IB views marked with #bc-ignore!.

Suggested Solution

bartycrouch export-xliff

Example Usage

bartycrouch export-xliff <destination-dir> <languages>

destination-dir: optional, defaults to .
languages: comma-separated list of language codes; optional, defaults to proj languages.

The exported format should be identical to Xcode's builtin export except that it ignores #bc-ignore! views.

Possible Involvement

  • I could help with implementation: no
  • I could help with testing: yes
@futuretap futuretap added the enhancement New feature or request label Jul 20, 2020
@lechuckcaptain
Copy link
Contributor

lechuckcaptain commented Jul 23, 2020

I had the same issue and after a couple of days of searching what's the best option available I found this nice hack:

https://stackoverflow.com/a/46991397/355465

Basically for terms ignored using the standard BartyCrouch notation #bc-ignore! you just need to launch the following command:

xmlstarlet ed -d "//*[contains(text(), 'Note = \"#bc-ignore')]/.." en.xliff > en_clean.xliff

I'm currently testing it in details and I'll keep the issue updated.

In any case it would be nice to have this feature somewhat available directly inside BartyCrouch, since it seems that we cannot trust Apple for having in Xcode 🤔

@FlineDevPublic
Copy link
Collaborator

FlineDevPublic commented Jan 14, 2022

@futuretap Thank you for reporting this feature request and sorry for answering so late. Maybe you don't have this issue anymore, but others may want the same thing, too, so let me share my thoughts on this:

In general I'm not sure if I want to bloat up BartyCrouch to be a tool that does everything related to localization. It was always meant to just fix the "missing parts" in Xcode, it's more like a feature filler. But I like the approach mentioned by @lechuckcaptain which can be done either with the command he shared above or we could actually also add a feature that does this change right within BartyCrouch, so you don't have to mess with another language or tool.

But as there's the above workaround, that's not top of my list of smaller features to add to BartyCrouch. I might consider it though sometime in the future. In any case if somebody wanted to add such a feature, I'm also happy to review good PRs. :)


This comment was written during my regular Open Source live stream on Twitch. Follow me there to support my work!

@FlineDevPublic FlineDevPublic added Priority: Low enhancement and removed enhancement New feature or request labels Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants