Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve french translation and R.string usage #364

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/java/com/samourai/wallet/LandingActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ private void startTor() {
if (state == TorManager.CONNECTION_STATES.CONNECTING) {
progressBarTor.setVisibility(View.VISIBLE);
torStatus.setVisibility(View.VISIBLE);
torStatus.setText("Tor service connecting...");
torStatus.setText(R.string.tor_service_connecting);
} else if (state == TorManager.CONNECTION_STATES.CONNECTED) {
PrefsUtil.getInstance(this).setValue(PrefsUtil.ENABLE_TOR, true);
torStatus.setVisibility(View.VISIBLE);
torStatusCheck.setVisibility(View.VISIBLE);
torStatus.setText("Tor Connected");
torStatus.setText(R.string.tor_connected);
progressBarTor.setVisibility(View.INVISIBLE);
torSwitch.setChecked(true);
// if(waitingForPairing) {
Expand Down
24 changes: 12 additions & 12 deletions app/src/main/java/com/samourai/wallet/network/NetworkDashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,14 @@ private void setDataConnectionState(CONNECTION_STATUS enabled) {
public void run() {
if (enabled == CONNECTION_STATUS.ENABLED) {
showOfflineMessage(false);
dataButton.setText("Disable");
dataButton.setText(R.string.disable);
dataConnectionIcon.setColorFilter(activeColor);
dataConnectionStatus.setText("Enabled");
dataConnectionStatus.setText(R.string.enabled);
} else {
dataButton.setText("Enable");
dataButton.setText(R.string.enable);
showOfflineMessage(true);
dataConnectionIcon.setColorFilter(disabledColor);
dataConnectionStatus.setText("Disabled");
dataConnectionStatus.setText(R.string.disabled);
}
}
});
Expand All @@ -304,17 +304,17 @@ private void setDojoConnectionState(CONNECTION_STATUS enabled) {
NetworkDashboard.this.runOnUiThread(new Runnable() {
public void run() {
if (enabled == CONNECTION_STATUS.ENABLED) {
dojoBtn.setText("Disable");
dojoBtn.setText(R.string.disable);
dojoConnectionIcon.setColorFilter(activeColor);
dojoConnectionStatus.setText("Enabled");
dojoConnectionStatus.setText(R.string.enabled);
} else if (enabled == CONNECTION_STATUS.CONFIGURE) {
dojoBtn.setText("configure");
dojoConnectionIcon.setColorFilter(waiting);
dojoConnectionStatus.setText("Not configured");
} else {
dojoBtn.setText("Enable");
dojoBtn.setText(R.string.enable);
dojoConnectionIcon.setColorFilter(disabledColor);
dojoConnectionStatus.setText("Disabled");
dojoConnectionStatus.setText(R.string.disabled);
}
}
});
Expand All @@ -325,10 +325,10 @@ private void setTorConnectionState(TorManager.CONNECTION_STATES enabled) {
Log.i(TAG, "setTorConnectionState: ".concat(String.valueOf(enabled)));
NetworkDashboard.this.runOnUiThread(() -> {
if (enabled == TorManager.CONNECTION_STATES.CONNECTED) {
torButton.setText("Disable");
torButton.setText(R.string.disable);
torButton.setEnabled(true);
torConnectionIcon.setColorFilter(activeColor);
torConnectionStatus.setText("Enabled");
torConnectionStatus.setText(R.string.enabled);
torRenewBtn.setVisibility(View.VISIBLE);
if(waitingForPairing) {
waitingForPairing = false;
Expand All @@ -351,10 +351,10 @@ else if (enabled == TorManager.CONNECTION_STATES.CONNECTING) {
}
else {
torRenewBtn.setVisibility(View.INVISIBLE);
torButton.setText("Enable");
torButton.setText(R.string.enable);
torButton.setEnabled(true);
torConnectionIcon.setColorFilter(disabledColor);
torConnectionStatus.setText("Disabled");
torConnectionStatus.setText(R.string.disabled);

/*
if (strPairingParams != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private void doClaimed(String res) {
final String strNymName = responseObj.getString("nymName");

AlertDialog.Builder dlg = new AlertDialog.Builder(ClaimPayNymActivity.this)
.setTitle("Your PayNym has been claimed")
.setTitle(R.string.paynym_claimed)
.setMessage(strNymName)
// .setView(imgLayout)
.setCancelable(false)
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/java/com/samourai/wallet/paynym/PayNymHome.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class PayNymHome extends AppCompatActivity {
private FloatingActionButton paynymFab;
private PaynymListFragment followersFragment, followingFragment;
private String pcode;
private String tabTitle[] = {"Following", "Followers"};
private String tabTitle[] = {"", ""};
private ArrayList<String> followers = new ArrayList<>();
private ConstraintLayout pcodeSyncLayout;
SwipeRefreshLayout swipeToRefreshPaynym;
Expand All @@ -106,6 +106,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pay_nym_home);
setSupportActionBar(findViewById(R.id.toolbar_paynym));
tabTitle[0] = getString(R.string.following);
tabTitle[1] = getString(R.string.followers);

paynymTabLayout = findViewById(R.id.paynym_tabs);
payNymViewPager = findViewById(R.id.paynym_viewpager);
Expand Down Expand Up @@ -148,7 +150,7 @@ protected void onCreate(Bundle savedInstanceState) {
return;
}
ArrayList<String> filtered = filterArchived(followersList);
tabTitle[1] = "Followers ".concat(" (").concat(String.valueOf(filtered.size())).concat(")");
tabTitle[1] = getString(R.string.followers).concat(" (").concat(String.valueOf(filtered.size())).concat(")");
followersFragment.addPcodes(followersList);
adapter.notifyDataSetChanged();
followers = followersList;
Expand All @@ -160,7 +162,7 @@ protected void onCreate(Bundle savedInstanceState) {
}
ArrayList<String> filtered = filterArchived(followingList);
followingFragment.addPcodes(filtered);
tabTitle[0] = "Following ".concat(" (").concat(String.valueOf(filtered.size())).concat(")");
tabTitle[0] = getString(R.string.following).concat(" (").concat(String.valueOf(filtered.size())).concat(")");
adapter.notifyDataSetChanged();

});
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/samourai/wallet/tor/TorService.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private NotificationCompat.Action getRestartAction() {
PendingIntent actionIntent = PendingIntent.getBroadcast(this,
0, broadcastIntent, PendingIntent.FLAG_UPDATE_CURRENT);

return new NotificationCompat.Action(R.drawable.tor_on, "New identity", actionIntent);
return new NotificationCompat.Action(R.drawable.tor_on, getString(R.string.new_identity), actionIntent);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_landing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="Enable Tor "
android:text="@string/enable_tor"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/activity_network_dashboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:text="Connections"
android:text="@string/connections"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
Expand Down Expand Up @@ -142,7 +142,7 @@
android:id="@+id/network_data_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Disabled" />
android:text="@string/disabled" />
</LinearLayout>

<Button
Expand All @@ -152,7 +152,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_weight=".5"
android:text="Disable"
android:text="@string/disable"
android:textColor="#6eb8c5" />
</LinearLayout>

Expand Down Expand Up @@ -196,7 +196,7 @@
android:id="@+id/network_tor_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Disabled" />
android:text="@string/disabled" />
</LinearLayout>


Expand All @@ -219,7 +219,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_weight="1.2"
android:text="Disable"
android:text="@string/disable"
android:textColor="#6eb8c5" />

</LinearLayout>
Expand Down Expand Up @@ -265,7 +265,7 @@
android:id="@+id/network_dojo_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Disabled" />
android:text="@string/disabled" />
</LinearLayout>

<Button
Expand All @@ -275,7 +275,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_weight=".5"
android:text="Disable"
android:text="@string/disable"
android:textColor="#6eb8c5" />
</LinearLayout>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_tx.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="Miner fee paid" />
android:text="@string/miner_fee_paid" />

<TextView
android:id="@+id/tx_miner_fee_paid"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/network_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:text="Enable"
android:text="@string/enable"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/textView11"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/send_form_segment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="To"
android:hint="@string/to"
android:imeOptions="flagNoPersonalizedLearning"
android:inputType="textNoSuggestions|textMultiLine"
android:maxLines="2"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/menu/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
/>

<item android:id="@+id/action_copy_cahoots"
android:title="Paste cahoots payload"
android:title="@string/paste_cahoots_payload"
android:orderInCategory="100"
app:showAsAction="never"
/>
Expand Down
Loading