Android Open Source - OBS-Translation-App Fake Translation Service






From Project

Back to project page OBS-Translation-App.

License

The source code is released under:

MIT License

If you think the Android project OBS-Translation-App listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.door43.obs.mta.service;
/*  www  .  j  ava  2  s  .  c  o  m*/
import org.door43.obs.mta.model.ITerm;
import org.door43.obs.mta.model.IText;
import org.door43.obs.mta.model.ITranslation;
import org.door43.obs.mta.model.ITranslationNotes;
import org.door43.obs.mta.model.Term;
import org.door43.obs.mta.model.Text;
import org.door43.obs.mta.model.Translation;
import org.door43.obs.mta.model.TranslationNotes;

public class FakeTranslationService implements ITranslationService {

  /* CONSTANTS */

    /* FIELDS */

    /* CONSTRUCTORS */

    /* METHODS */

    @Override
    public ITranslation loadTranslation(String frameId, String langCode) {

        ITranslation translation = new Translation();

        translation.setFrameId(frameId);
        translation.setLangCode(langCode);
        translation.setText("This is my translation of the story frame text...");

        return translation;
    }

    @Override
    public boolean saveTranslation(ITranslation translation) {
        return true;
    }

    @Override
    public IText loadOriginalText(String frameId, String langCode) {

        IText text = new Text("31-01", "en_US",
                "Then Jesus told the disciples to get into the boat and sail to the other side of the lake while he dismissed the crowd. After Jesus had sent the crowd away, he went up on a mountainside to pray. Jesus was there all alone, and he prayed until late at night.");

        return null;
    }

    @Override
    public ITranslationNotes loadTranslationNotes(String frameId) {

        ITranslationNotes notes = new TranslationNotes();

        notes.setFrameId(frameId);

        ITerm term1 = new Term("he dismissed the crowd",
                "This is another way of saying, he sent the crowd on their way?? or, he told the crowd of people to go back to their homes.??");

        ITerm term2 = new Term("mountainside","That is, the side of a mountain.??");

        final String notesString =
                "he dismissed the crowd - This is another way of saying, he sent the crowd on their way?? or, he told the crowd of people to go back to their homes." +
                        "\n\nmountainside - That is, the side of a mountain.??\"";

        notes.setNotes(notesString);

        return notes;
    }

    public void close(){
        // no resource to close
    }

    /* GETTERS AND SETTERS */

    /* OBJECT METHODS */

}




Java Source Code List

com.door43.obt.ata.MenuListActivity.java
com.door43.obt.ata.MenuListFragment.java
com.door43.obt.ata.RowAdapter.java
com.door43.obt.ata.SplashActivity.java
com.door43.obt.ata.TranslationDetailActivity.java
com.door43.obt.ata.TranslationFragment.java
org.door43.obs.mta.ConstApp.java
org.door43.obs.mta.db.AbstractDBHelper.java
org.door43.obs.mta.db.ConstTranslations.java
org.door43.obs.mta.db.TranslationDBHelper.java
org.door43.obs.mta.model.Frame.java
org.door43.obs.mta.model.IFrame.java
org.door43.obs.mta.model.IPersistenceObject.java
org.door43.obs.mta.model.ITerm.java
org.door43.obs.mta.model.IText.java
org.door43.obs.mta.model.ITranslationNotes.java
org.door43.obs.mta.model.ITranslation.java
org.door43.obs.mta.model.PersistenceObject.java
org.door43.obs.mta.model.Term.java
org.door43.obs.mta.model.Text.java
org.door43.obs.mta.model.TranslationNotes.java
org.door43.obs.mta.model.Translation.java
org.door43.obs.mta.service.FakeTranslationService.java
org.door43.obs.mta.service.ITranslationService.java
org.door43.obs.mta.service.TranslationService.java
org.door43.obs.mta.util.AssetsUtil.java
org.door43.obs.mta.util.StringUtils.java