Add language dropdown to compose view (#2651)
* Add UI for selecting post language * Apply selected language when sending status * Save/restore post language with drafts * Fall back to english if the configured language isn't found in the locale list (no-NB) * Remove comment about no_NB * Move language dropdown to top of compose view * Preserve language when redrafting * Set default language to target post's language when replying * Add Tusky license header to new source file * Tweak language dropdown button width
This commit is contained in:
parent
c638ad7e6b
commit
0041acf2d4
28 changed files with 1140 additions and 28 deletions
|
|
@ -31,7 +31,7 @@ import java.io.File;
|
|||
*/
|
||||
@Database(entities = { DraftEntity.class, AccountEntity.class, InstanceEntity.class, TimelineStatusEntity.class,
|
||||
TimelineAccountEntity.class, ConversationEntity.class
|
||||
}, version = 41)
|
||||
}, version = 42)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
public abstract AccountDao accountDao();
|
||||
|
|
@ -601,4 +601,13 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||
database.execSQL("ALTER TABLE `DraftEntity` ADD COLUMN `scheduledAt` TEXT");
|
||||
}
|
||||
};
|
||||
|
||||
public static final Migration MIGRATION_41_42 = new Migration(41, 42) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE `DraftEntity` ADD COLUMN `language` TEXT");
|
||||
database.execSQL("ALTER TABLE `TimelineStatusEntity` ADD COLUMN `language` TEXT");
|
||||
database.execSQL("ALTER TABLE `ConversationEntity` ADD COLUMN `s_language` TEXT");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ data class DraftEntity(
|
|||
val poll: NewPoll?,
|
||||
val failedToSend: Boolean,
|
||||
val scheduledAt: String?,
|
||||
val language: String?,
|
||||
)
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ data class TimelineStatusEntity(
|
|||
val contentShowing: Boolean,
|
||||
val pinned: Boolean,
|
||||
val card: String?,
|
||||
val language: String?,
|
||||
)
|
||||
|
||||
@Entity(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue