dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #03017
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1013: Removed function for separate locale for alternative name properties.
------------------------------------------------------------
revno: 1013
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-11-10 00:22:20 +0100
message:
Removed function for separate locale for alternative name properties.
modified:
dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/DefaultI18nService.java
dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/I18nService.java
dhis-2/dhis-i18n/dhis-i18n-db/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java
dhis-2/dhis-i18n/dhis-i18n-upgrader/src/main/java/org/hisp/dhis/i18n/I18nUpgrader.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/DefaultI18nService.java'
--- dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/DefaultI18nService.java 2009-11-09 22:48:39 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/DefaultI18nService.java 2009-11-09 23:22:20 +0000
@@ -325,23 +325,6 @@
// Translation
// -------------------------------------------------------------------------
- public void addTranslation( Object object, String property, String value, Locale locale )
- {
- if ( !isI18nObject( object ) | object == null )
- {
- return;
- }
-
- String className = getClassName( object );
- int id = getId( object );
-
- Map<String, String> translations = new Hashtable<String, String>();
-
- translations.put( property, value );
-
- updateTranslation( className, id, locale, translations );
- }
-
public void updateTranslation( String className, int id, Locale locale, Map<String, String> translations )
{
for ( Map.Entry<String,String> translationEntry : translations.entrySet() )
=== modified file 'dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/I18nService.java'
--- dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/I18nService.java 2009-11-09 22:48:39 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/I18nService.java 2009-11-09 23:22:20 +0000
@@ -63,8 +63,6 @@
// Translation
// -------------------------------------------------------------------------
- public void addTranslation( Object object, String property, String value, Locale locale );
-
public void updateTranslation( String className, int id, Locale thisLocale, Map<String, String> translations );
public Map<String, String> getTranslations( String className, int id, Locale locale );
=== modified file 'dhis-2/dhis-i18n/dhis-i18n-db/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java'
--- dhis-2/dhis-i18n/dhis-i18n-db/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java 2009-11-09 22:14:51 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-db/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java 2009-11-09 23:22:20 +0000
@@ -273,23 +273,6 @@
}
@Test
- public void testAddTranslation()
- throws Exception
- {
- OrganisationUnit organisationUnit1 = new OrganisationUnit( "orgunit", "shortName1", "organisationUnitCode1",
- new Date(), new Date(), true, "comment" );
- organisationUnit1.setId( id1 );
-
- i18nService.addTranslation( organisationUnit1, "name", "orgunit-1", Locale.UK );
-
- localeManager.setCurrentLocale( Locale.UK );
-
- i18nService.internationalise( organisationUnit1 );
-
- assertEquals( "orgunit-1", organisationUnit1.getName() );
- }
-
- @Test
public void testSetToFallback()
throws Exception
{
=== modified file 'dhis-2/dhis-i18n/dhis-i18n-upgrader/src/main/java/org/hisp/dhis/i18n/I18nUpgrader.java'
--- dhis-2/dhis-i18n/dhis-i18n-upgrader/src/main/java/org/hisp/dhis/i18n/I18nUpgrader.java 2009-10-18 22:44:41 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-upgrader/src/main/java/org/hisp/dhis/i18n/I18nUpgrader.java 2009-11-09 23:22:20 +0000
@@ -44,7 +44,6 @@
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.i18n.locale.LocaleManager;
-import org.hisp.dhis.i18n.util.LocaleUtils;
import org.hisp.dhis.indicator.Indicator;
import org.hisp.dhis.indicator.IndicatorGroup;
import org.hisp.dhis.indicator.IndicatorService;
@@ -143,17 +142,9 @@
this.i18nService = i18nService;
}
- private Locale alternativeNameLocale = null;
-
- public void setAlternativeNameLocale( String alternativeNameLocale )
- {
- this.alternativeNameLocale = LocaleUtils.getLocale( alternativeNameLocale );
- }
-
// -------------------------------------------------------------------------
// Execute
// -------------------------------------------------------------------------
-
public void execute()
{
@@ -178,16 +169,7 @@
localeManager.setCurrentLocale( localeManager.getFallbackLocale() );
- String alternativeNameDescription = "";
-
- if ( alternativeNameLocale != null )
- {
- alternativeNameDescription = " and " + alternativeNameLocale.getDisplayName()
- + " for alternative names";
- }
-
- log.info( "I18n Upgrader running using locale " + localeManager.getFallbackLocale().getDisplayName()
- + alternativeNameDescription );
+ log.info( "I18n Upgrader running using locale " + localeManager.getFallbackLocale().getDisplayName() );
// ---------------------------------------------------------------------
// DataElement
@@ -202,12 +184,6 @@
for ( DataElement dataElement : dataElements )
{
i18nService.addObject( dataElement );
-
- if ( alternativeNameLocale != null && dataElement.getAlternativeName() != null )
- {
- i18nService.addTranslation( dataElement, "name", dataElement.getAlternativeName(),
- alternativeNameLocale );
- }
}
}
@@ -240,12 +216,6 @@
for ( Indicator indicator : indicators )
{
i18nService.addObject( indicator );
-
- if ( alternativeNameLocale != null && indicator.getAlternativeName() != null )
- {
- i18nService.addTranslation( indicator, "name", indicator.getAlternativeName(),
- alternativeNameLocale );
- }
}
}