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

Commit

Permalink
Merge branch 'integration/master' of github.com:zanata/zanata into in…
Browse files Browse the repository at this point in the history
…tegration/master
  • Loading branch information
davidmason committed Apr 18, 2012
2 parents 3cb236b + 36a92dc commit 38156bc
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 38156bc

Please sign in to comment.