Skip to content

Commit

Permalink
fix: Add optional language tag for Lift export (#68)
Browse files Browse the repository at this point in the history
* fix: Add optional language tag for Lift export

* chore: tweak label

* chore: Merge conflict in SA_ENU.rc
  • Loading branch information
darcywong00 authored Mar 3, 2022
1 parent a5601ce commit a2b8be5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
8 changes: 5 additions & 3 deletions Src/Lang/SA_DEU.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2480,9 +2480,11 @@ BEGIN
DEFPUSHBUTTON "Export",IDOK,123,243,50,14,WS_DISABLED
GROUPBOX "Include",IDC_STATIC,9,6,271,170
PUSHBUTTON "&Help",IDHELP,231,243,50,14
LTEXT "Export Folder",IDC_STATIC_FIELDWORKS_PROJECT,15,181,260,8
EDITTEXT IDC_EDIT_FOLDER,15,195,212,14,ES_AUTOHSCROLL
PUSHBUTTON "Browse...",IDC_BROWSE,231,195,50,14
LTEXT "Language Tag if Orthographic unchecked", IDC_OPTIONAL_LANGUAGE_TAG_LABEL, 15, 181, 260, 8
EDITTEXT IDC_OPTIONAL_LANGUAGE_TAG, 15, 195, 212, 14, ES_AUTOHSCROLL | ES_WANTRETURN
LTEXT "Export Folder", IDC_STATIC_FIELDWORKS_PROJECT, 15, 214, 260, 8
EDITTEXT IDC_EDIT_FOLDER, 15, 225, 212, 14, ES_AUTOHSCROLL
PUSHBUTTON "Browse...",IDC_BROWSE,231,225,50,14
END

IDD_SELECT_TRANSCRIPTION_BARS DIALOGEX 0, 0, 116, 144
Expand Down
8 changes: 5 additions & 3 deletions Src/Lang/SA_ENU.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2480,9 +2480,11 @@ PUSHBUTTON "Cancel", IDCANCEL, 177, 243, 50, 14
DEFPUSHBUTTON "Export", IDOK, 123, 243, 50, 14, WS_DISABLED
GROUPBOX "Include", IDC_STATIC, 9, 6, 271, 170
PUSHBUTTON "&Help", IDHELP, 231, 243, 50, 14
LTEXT "Export Folder", IDC_STATIC_FIELDWORKS_PROJECT, 15, 181, 260, 8
EDITTEXT IDC_EDIT_FOLDER, 15, 195, 212, 14, ES_AUTOHSCROLL
PUSHBUTTON "Browse...", IDC_BROWSE, 231, 195, 50, 14
LTEXT "Language Tag if Orthographic unchecked", IDC_OPTIONAL_LANGUAGE_TAG_LABEL, 15, 181, 260, 8
EDITTEXT IDC_OPTIONAL_LANGUAGE_TAG, 15, 195, 212, 14, ES_AUTOHSCROLL | ES_WANTRETURN
LTEXT "Export Folder", IDC_STATIC_FIELDWORKS_PROJECT, 15, 214, 260, 8
EDITTEXT IDC_EDIT_FOLDER, 15, 225, 212, 14, ES_AUTOHSCROLL
PUSHBUTTON "Browse...", IDC_BROWSE, 231, 225, 50, 14
END

IDD_SELECT_TRANSCRIPTION_BARS DIALOGEX 0, 0, 116, 144
Expand Down
2 changes: 2 additions & 0 deletions Src/Lang/sa_lang_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,8 @@
#define IDC_CHECK_USE_LAST_FILE 2066
#define IDC_RADIO_FIELDWORKS 2067
#define IDC_RADIO_OTHER 2068
#define IDC_OPTIONAL_LANGUAGE_TAG_LABEL 2069
#define IDC_OPTIONAL_LANGUAGE_TAG 2070
#define IDC_EDIT_FIELDWORKS_FOLDER 2071
#define IDC_STATIC_OTHER 2072
#define IDC_STATIC_FIELDWORKS 2073
Expand Down
1 change: 1 addition & 0 deletions Src/SA/DlgExportLift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ void CDlgExportLift::DoDataExchange(CDataExchange * pDX) {
DDX_Control(pDX, IDC_LIST_MUSIC_PL1, ctlPhraseList1List);
DDX_Control(pDX, IDC_LIST_MUSIC_PL2, ctlPhraseList2List);
DDX_Control(pDX, IDC_EDIT_FOLDER, ctlEditFolder);
DDX_CBString(pDX, IDC_OPTIONAL_LANGUAGE_TAG, settings.optionalLanguageTag);

if (pDX->m_bSaveAndValidate) {

Expand Down
1 change: 1 addition & 0 deletions Src/SA/ExportLiftSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CExportLiftSettings {
wstring phrase1;
wstring phrase2;

CSaString optionalLanguageTag;
CString szDocTitle;
CString szPath;
};
Expand Down
6 changes: 3 additions & 3 deletions Src/SA/Sa_Doc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7481,12 +7481,12 @@ bool CSaDoc::ExportSegments(CExportLiftSettings & settings,
entry.lexical_unit.get().form.append(Lift13::form(L"form", settings.ortho.c_str(), Lift13::text(LTEXT, Lift13::span(SPAN, results[ORTHO]))));
}

// Build the IPA language tags from what's available (Orthographic or "Ethnologue ID"). Fall back to "und" (BCP-47 for undefined)
// Build the IPA language tags from what's available (Orthographic or "Optional Language Tag"). Fall back to "und" (BCP-47 for undefined)
wstring vernacular = L"und";
if (settings.bOrtho) {
vernacular = settings.ortho;
} else if (m_sourceParm.szEthnoID.Compare(L" ") != 0) {
vernacular = FileUtils::Trim(wstring(m_sourceParm.szEthnoID));
} else if (!settings.optionalLanguageTag.IsEmpty()) {
vernacular = settings.optionalLanguageTag;
}

// add the phonetic
Expand Down

0 comments on commit a2b8be5

Please sign in to comment.