forked from sk22/megalodon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Translations for Akkoma * simplify akkoma translation code --------- Co-authored-by: sk <[email protected]>
- Loading branch information
1 parent
18ea9c1
commit 40658ea
Showing
6 changed files
with
76 additions
and
25 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...n/src/main/java/org/joinmastodon/android/api/requests/statuses/AkkomaTranslateStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.joinmastodon.android.api.requests.statuses; | ||
|
||
import org.joinmastodon.android.api.MastodonAPIRequest; | ||
import org.joinmastodon.android.model.AkkomaTranslation; | ||
|
||
public class AkkomaTranslateStatus extends MastodonAPIRequest<AkkomaTranslation>{ | ||
public AkkomaTranslateStatus(String id, String lang){ | ||
super(HttpMethod.GET, "/statuses/"+id+"/translations/"+lang.toUpperCase(), AkkomaTranslation.class); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
mastodon/src/main/java/org/joinmastodon/android/model/AkkomaTranslation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.joinmastodon.android.model; | ||
|
||
public class AkkomaTranslation extends BaseModel{ | ||
public String text; | ||
public String detectedLanguage; | ||
|
||
public Translation toTranslation() { | ||
Translation translation=new Translation(); | ||
translation.content=text; | ||
translation.detectedSourceLanguage=detectedLanguage; | ||
translation.provider="Akkoma"; | ||
return translation; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters