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

Allow duplicates #25

Merged
merged 5 commits into from May 13, 2019
Merged

Conversation

@fhogberg
Copy link
Contributor

@fhogberg fhogberg commented May 13, 2019

Patch to allow for export even if there are duplicate resources with the same key.
New -d option added to allow this

}
else
{
var resourceEntry = new LocalizationResource
{
ResourceKey = resourceKey,
ResourceKey = resourceKey.ToLower(),
Copy link
Owner

@valdisiljuconoks valdisiljuconoks May 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure about this line.. It might cause problems later to look up this resource as not yet everywhere resource key is made case insensitive

Loading

Copy link
Contributor Author

@fhogberg fhogberg May 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the assumption that once in epi keys are case insensitive because trying to import a json with same key with different case throws an exception. If that is true it should not matter that all keys are made lowercase.
Is it intended that keys are case sensitive? In that case the current behaiviour is correct and the import should be modified to allow it.

Loading

Copy link
Owner

@valdisiljuconoks valdisiljuconoks May 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case sensitivity is for generated keys from code (for now). this will be changed in next major version.
is it possible for you to try out to import key in UPPER case and call Episerver API with lower? This might collide with use case when migration is done for "normal" resources (like with key Namespace.Class.Property)

Loading

@valdisiljuconoks
Copy link
Owner

@valdisiljuconoks valdisiljuconoks commented May 13, 2019

thanks for PR. this is much appreciated and duplicates definitely could be an issue when dealing with pile of XML files.. Can you please check that line regarding resourceKey.ToLower() ?

Loading

@fhogberg
Copy link
Contributor Author

@fhogberg fhogberg commented May 13, 2019

Pushed a new commit.
Now the compare is case insensitive but the key is imported in correct case of the first occurance of the key.
Will this work?

Loading

@valdisiljuconoks
Copy link
Owner

@valdisiljuconoks valdisiljuconoks commented May 13, 2019

yup, this might blend

Loading

@valdisiljuconoks valdisiljuconoks merged commit fa769dc into valdisiljuconoks:master May 13, 2019
@valdisiljuconoks valdisiljuconoks added this to the 5.7 milestone May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants