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

All leafs are complete-lowercased with dot-syntax-swift3 template #226

Closed
Jeehut opened this issue Dec 6, 2016 · 1 comment · Fixed by #233
Closed

All leafs are complete-lowercased with dot-syntax-swift3 template #226

Jeehut opened this issue Dec 6, 2016 · 1 comment · Fixed by #233

Comments

@Jeehut
Copy link
Collaborator

Jeehut commented Dec 6, 2016

When using the dot-syntax-swift3 template and having the key

WORD_POOL_ITEM_FORM.NOTIFICATION.QUICK_ADD_INFO

the usage in code currently is:

L10n.WordPoolItemForm.Notification.quickaddinfo

As you can see the last part is not camelCased anymore. I'd expect it to be quickAddInfo though.

@djbe
Copy link
Member

djbe commented Dec 6, 2016

It works for non-uppercase keys, for:
"WORD_POOL_ITEM_FORM.NOTIFICATION.quick_add_info" = "Something";
I get the correct result
L10n.WordPoolItemForm.Notification.quickAddInfo

It goes wrong between these filters:

  • titlecase: QUICK_ADD_INFO
  • snakeToCamelCase: QUICKADDINFO

Jeehut added a commit that referenced this issue Dec 7, 2016
Note that I supposed the reason for not lowercasing the tail
was to not break already camel cased string as input:

Therefore I’ve made sure camel cased strings are kept as they
are by snake casing them before titlecasing their parts.

This attempts to fix #226.
@djbe djbe closed this as completed in #233 Jan 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants