Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
rhbz812205 - Change function that determines a translation unit's state.
This change will fix a backward incompatibility with previous server versions.
  • Loading branch information
Carlos Munoz committed Apr 18, 2012
1 parent 9d3d191 commit 54df7f5
Showing 1 changed file with 19 additions and 5 deletions.
Expand Up @@ -310,20 +310,34 @@ private static boolean allEmpty(List<String> strings)

static ContentState getContentState(Message message)
{
boolean fuzzy = message.isFuzzy();
if (message.isPlural() && allEmpty(message.getMsgstrPlural()))
return getContentState(message.isFuzzy(), message.getMsgstr(), message.isPlural(), message.getMsgstrPlural());
}

private static ContentState getContentState(boolean fuzzy, String msgstr, boolean plural, List<String> msgstrPlural)
{
if (plural && allEmpty(msgstrPlural))
{
fuzzy = false;
}
if (fuzzy)
{
return ContentState.NeedReview;
}
if ((message.getMsgstr() != null && !message.getMsgstr().isEmpty()) || allNonEmpty(message.getMsgstrPlural()))

if (plural)
{
return ContentState.Approved;
if (allNonEmpty(msgstrPlural))
return ContentState.Approved;
else
return ContentState.New;
}
else
{
if (msgstr == null || msgstr.isEmpty())
return ContentState.New;
else
return ContentState.Approved;
}
return ContentState.New;
}

static String createId(Message message)
Expand Down

0 comments on commit 54df7f5

Please sign in to comment.