Skip to content

Commit

Permalink
adding locale utilities. Contribution coming from SourceForge.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Robert committed Mar 16, 2012
1 parent 75b19aa commit 0ca8ca4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXKey.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package er.extensions.eof;

import java.math.BigDecimal;
import java.util.Locale;

import com.webobjects.eocontrol.EOQualifier;
import com.webobjects.foundation.NSArray;
Expand Down Expand Up @@ -1273,6 +1274,30 @@ public ERXSortOrdering.ERXSortOrderings descInsensitives() {
public String key() {
return _key;
}

/**
* Returns a localized key.
*
* @param locale
* locale for the new key.
*
* @return localized key
*/
public ERXKey<T> loc(String locale) {
return new ERXKey(key(), locale);
}

/**
* Returns a localized key.
*
* @param locale
* locale for the new key.
*
* @return localized key
*/
public ERXKey<T> loc(Locale locale) {
return new ERXKey(key(), locale.getLanguage().toLowerCase());
}

/**
* Equivalent to new ERXKeyValueQualifier(key,
Expand Down

0 comments on commit 0ca8ca4

Please sign in to comment.