this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

DRY this part

+138 -158
+31 -50
src/components/status.jsx
··· 1105 1105 </MenuItem> 1106 1106 </> 1107 1107 )} 1108 - {!mediaFirst && ( 1108 + {!mediaFirst && (enableTranslate || !language || differentLanguage) && ( 1109 1109 <> 1110 - {(enableTranslate || !language || differentLanguage) && ( 1111 - <MenuDivider /> 1112 - )} 1113 - {enableTranslate ? ( 1114 - <div class={supportsTTS ? 'menu-horizontal' : ''}> 1110 + <MenuDivider /> 1111 + <div class={supportsTTS ? 'menu-horizontal' : ''}> 1112 + {enableTranslate ? ( 1115 1113 <MenuItem 1116 1114 disabled={forceTranslate} 1117 - onClick={() => { 1118 - setForceTranslate(true); 1119 - }} 1115 + onClick={() => setForceTranslate(true)} 1120 1116 > 1121 1117 <Icon icon="translate" /> 1122 1118 <span> 1123 1119 <Trans>Translate</Trans> 1124 1120 </span> 1125 1121 </MenuItem> 1126 - {supportsTTS && ( 1127 - <MenuItem 1128 - onClick={() => { 1122 + ) : ( 1123 + <MenuLink 1124 + to={`${instance ? `/${instance}` : ''}/s/${id}?translate=1`} 1125 + > 1126 + <Icon icon="translate" /> 1127 + <span> 1128 + <Trans>Translate</Trans> 1129 + </span> 1130 + </MenuLink> 1131 + )} 1132 + {supportsTTS && ( 1133 + <MenuItem 1134 + onClick={() => { 1135 + try { 1129 1136 const postText = getPostText(status); 1130 1137 if (postText) { 1131 1138 speak(postText, language); 1132 1139 } 1133 - }} 1134 - > 1135 - <Icon icon="speak" /> 1136 - <span> 1137 - <Trans>Speak</Trans> 1138 - </span> 1139 - </MenuItem> 1140 - )} 1141 - </div> 1142 - ) : ( 1143 - (!language || differentLanguage) && ( 1144 - <div class={supportsTTS ? 'menu-horizontal' : ''}> 1145 - <MenuLink 1146 - to={`${instance ? `/${instance}` : ''}/s/${id}?translate=1`} 1147 - > 1148 - <Icon icon="translate" /> 1149 - <span> 1150 - <Trans>Translate</Trans> 1151 - </span> 1152 - </MenuLink> 1153 - {supportsTTS && ( 1154 - <MenuItem 1155 - onClick={() => { 1156 - const postText = getPostText(status); 1157 - if (postText) { 1158 - speak(postText, language); 1159 - } 1160 - }} 1161 - > 1162 - <Icon icon="speak" /> 1163 - <span> 1164 - <Trans>Speak</Trans> 1165 - </span> 1166 - </MenuItem> 1167 - )} 1168 - </div> 1169 - ) 1170 - )} 1140 + } catch (error) { 1141 + console.error('Failed to speak text:', error); 1142 + } 1143 + }} 1144 + > 1145 + <Icon icon="speak" /> 1146 + <span> 1147 + <Trans>Speak</Trans> 1148 + </span> 1149 + </MenuItem> 1150 + )} 1151 + </div> 1171 1152 </> 1172 1153 )} 1173 1154 {((!isSizeLarge && sameInstance) ||
+107 -108
src/locales/en.po
··· 111 111 #: src/components/compose.jsx:2772 112 112 #: src/components/media-alt-modal.jsx:46 113 113 #: src/components/media-modal.jsx:358 114 - #: src/components/status.jsx:1794 115 - #: src/components/status.jsx:1811 116 - #: src/components/status.jsx:1936 117 - #: src/components/status.jsx:2554 118 - #: src/components/status.jsx:2557 114 + #: src/components/status.jsx:1775 115 + #: src/components/status.jsx:1792 116 + #: src/components/status.jsx:1917 117 + #: src/components/status.jsx:2535 118 + #: src/components/status.jsx:2538 119 119 #: src/pages/account-statuses.jsx:523 120 120 #: src/pages/accounts.jsx:110 121 121 #: src/pages/hashtag.jsx:200 ··· 203 203 msgstr "" 204 204 205 205 #: src/components/account-info.jsx:926 206 - #: src/components/status.jsx:2338 206 + #: src/components/status.jsx:2319 207 207 #: src/pages/catchup.jsx:72 208 208 #: src/pages/catchup.jsx:1442 209 209 #: src/pages/catchup.jsx:2057 ··· 300 300 msgstr "" 301 301 302 302 #: src/components/account-info.jsx:1384 303 - #: src/components/status.jsx:1234 303 + #: src/components/status.jsx:1215 304 304 msgid "Link copied" 305 305 msgstr "" 306 306 307 307 #: src/components/account-info.jsx:1387 308 - #: src/components/status.jsx:1237 308 + #: src/components/status.jsx:1218 309 309 msgid "Unable to copy link" 310 310 msgstr "" 311 311 312 312 #: src/components/account-info.jsx:1393 313 313 #: src/components/shortcuts-settings.jsx:1059 314 - #: src/components/status.jsx:1243 315 - #: src/components/status.jsx:3325 314 + #: src/components/status.jsx:1224 315 + #: src/components/status.jsx:3306 316 316 msgid "Copy" 317 317 msgstr "" 318 318 319 319 #: src/components/account-info.jsx:1408 320 320 #: src/components/shortcuts-settings.jsx:1077 321 - #: src/components/status.jsx:1259 321 + #: src/components/status.jsx:1240 322 322 msgid "Sharing doesn't seem to work." 323 323 msgstr "" 324 324 325 325 #: src/components/account-info.jsx:1414 326 - #: src/components/status.jsx:1265 326 + #: src/components/status.jsx:1246 327 327 msgid "Share…" 328 328 msgstr "" 329 329 ··· 437 437 #: src/components/shortcuts-settings.jsx:230 438 438 #: src/components/shortcuts-settings.jsx:583 439 439 #: src/components/shortcuts-settings.jsx:783 440 - #: src/components/status.jsx:3049 441 - #: src/components/status.jsx:3289 442 - #: src/components/status.jsx:3798 440 + #: src/components/status.jsx:3030 441 + #: src/components/status.jsx:3270 442 + #: src/components/status.jsx:3779 443 443 #: src/pages/accounts.jsx:37 444 444 #: src/pages/catchup.jsx:1578 445 445 #: src/pages/filters.jsx:225 ··· 680 680 msgstr "Attachment #{i} failed" 681 681 682 682 #: src/components/compose.jsx:1211 683 - #: src/components/status.jsx:2124 683 + #: src/components/status.jsx:2105 684 684 #: src/components/timeline.jsx:993 685 685 msgid "Content warning" 686 686 msgstr "" ··· 716 716 717 717 #: src/components/compose.jsx:1278 718 718 #: src/components/status.jsx:100 719 - #: src/components/status.jsx:2000 719 + #: src/components/status.jsx:1981 720 720 msgid "Private mention" 721 721 msgstr "" 722 722 ··· 754 754 #: src/components/compose.jsx:1664 755 755 #: src/components/keyboard-shortcuts-help.jsx:154 756 756 #: src/components/status.jsx:1008 757 - #: src/components/status.jsx:1774 758 - #: src/components/status.jsx:1775 759 - #: src/components/status.jsx:2458 757 + #: src/components/status.jsx:1755 758 + #: src/components/status.jsx:1756 759 + #: src/components/status.jsx:2439 760 760 msgid "Reply" 761 761 msgstr "" 762 762 ··· 978 978 979 979 #: src/components/drafts.jsx:128 980 980 #: src/components/list-add-edit.jsx:186 981 - #: src/components/status.jsx:1409 981 + #: src/components/status.jsx:1390 982 982 #: src/pages/filters.jsx:603 983 983 #: src/pages/scheduled-posts.jsx:367 984 984 msgid "Delete…" ··· 1188 1188 1189 1189 #: src/components/keyboard-shortcuts-help.jsx:175 1190 1190 #: src/components/status.jsx:1016 1191 - #: src/components/status.jsx:2485 1192 - #: src/components/status.jsx:2508 1193 - #: src/components/status.jsx:2509 1191 + #: src/components/status.jsx:2466 1192 + #: src/components/status.jsx:2489 1193 + #: src/components/status.jsx:2490 1194 1194 msgid "Boost" 1195 1195 msgstr "" 1196 1196 ··· 1200 1200 1201 1201 #: src/components/keyboard-shortcuts-help.jsx:183 1202 1202 #: src/components/status.jsx:1079 1203 - #: src/components/status.jsx:2533 1204 - #: src/components/status.jsx:2534 1203 + #: src/components/status.jsx:2514 1204 + #: src/components/status.jsx:2515 1205 1205 msgid "Bookmark" 1206 1206 msgstr "" 1207 1207 ··· 1260 1260 msgstr "" 1261 1261 1262 1262 #: src/components/media-alt-modal.jsx:58 1263 - #: src/components/status.jsx:1123 1264 - #: src/components/status.jsx:1150 1263 + #: src/components/status.jsx:1119 1264 + #: src/components/status.jsx:1128 1265 1265 #: src/components/translation-block.jsx:215 1266 1266 msgid "Translate" 1267 1267 msgstr "" 1268 1268 1269 1269 #: src/components/media-alt-modal.jsx:69 1270 - #: src/components/status.jsx:1137 1271 - #: src/components/status.jsx:1164 1270 + #: src/components/status.jsx:1147 1272 1271 msgid "Speak" 1273 1272 msgstr "" 1274 1273 ··· 1305 1304 msgstr "" 1306 1305 1307 1306 #: src/components/media-post.jsx:134 1308 - #: src/components/status.jsx:3628 1309 - #: src/components/status.jsx:3724 1310 - #: src/components/status.jsx:3802 1307 + #: src/components/status.jsx:3609 1308 + #: src/components/status.jsx:3705 1309 + #: src/components/status.jsx:3783 1311 1310 #: src/components/timeline.jsx:982 1312 1311 #: src/pages/catchup.jsx:76 1313 1312 #: src/pages/catchup.jsx:1876 ··· 1948 1947 msgstr "" 1949 1948 1950 1949 #: src/components/shortcuts-settings.jsx:379 1951 - #: src/components/status.jsx:1371 1950 + #: src/components/status.jsx:1352 1952 1951 #: src/pages/list.jsx:171 1953 1952 msgid "Edit" 1954 1953 msgstr "" ··· 2186 2185 2187 2186 #: src/components/status.jsx:1016 2188 2187 #: src/components/status.jsx:1056 2189 - #: src/components/status.jsx:2485 2190 - #: src/components/status.jsx:2508 2188 + #: src/components/status.jsx:2466 2189 + #: src/components/status.jsx:2489 2191 2190 msgid "Unboost" 2192 2191 msgstr "" 2193 2192 2194 2193 #: src/components/status.jsx:1032 2195 - #: src/components/status.jsx:2500 2194 + #: src/components/status.jsx:2481 2196 2195 msgid "Quote" 2197 2196 msgstr "" 2198 2197 2199 2198 #. placeholder {0}: username || acct 2200 2199 #: src/components/status.jsx:1044 2201 - #: src/components/status.jsx:1499 2200 + #: src/components/status.jsx:1480 2202 2201 msgid "Unboosted @{0}'s post" 2203 2202 msgstr "Unboosted @{0}'s post" 2204 2203 2205 2204 #. placeholder {0}: username || acct 2206 2205 #: src/components/status.jsx:1045 2207 - #: src/components/status.jsx:1500 2206 + #: src/components/status.jsx:1481 2208 2207 msgid "Boosted @{0}'s post" 2209 2208 msgstr "Boosted @{0}'s post" 2210 2209 ··· 2213 2212 msgstr "" 2214 2213 2215 2214 #: src/components/status.jsx:1069 2216 - #: src/components/status.jsx:1784 2217 - #: src/components/status.jsx:2521 2215 + #: src/components/status.jsx:1765 2216 + #: src/components/status.jsx:2502 2218 2217 msgid "Unlike" 2219 2218 msgstr "" 2220 2219 2221 2220 #: src/components/status.jsx:1070 2222 - #: src/components/status.jsx:1784 2223 - #: src/components/status.jsx:1785 2224 - #: src/components/status.jsx:2521 2225 - #: src/components/status.jsx:2522 2221 + #: src/components/status.jsx:1765 2222 + #: src/components/status.jsx:1766 2223 + #: src/components/status.jsx:2502 2224 + #: src/components/status.jsx:2503 2226 2225 msgid "Like" 2227 2226 msgstr "" 2228 2227 2229 2228 #: src/components/status.jsx:1079 2230 - #: src/components/status.jsx:2533 2229 + #: src/components/status.jsx:2514 2231 2230 msgid "Unbookmark" 2232 2231 msgstr "" 2233 2232 2234 2233 #. placeholder {0}: username || acct 2235 - #: src/components/status.jsx:1187 2234 + #: src/components/status.jsx:1168 2236 2235 msgid "View post by <0>@{0}</0>" 2237 2236 msgstr "" 2238 2237 2239 - #: src/components/status.jsx:1208 2238 + #: src/components/status.jsx:1189 2240 2239 msgid "Show Edit History" 2241 2240 msgstr "" 2242 2241 2243 - #: src/components/status.jsx:1211 2242 + #: src/components/status.jsx:1192 2244 2243 msgid "Edited: {editedDateText}" 2245 2244 msgstr "" 2246 2245 2247 - #: src/components/status.jsx:1278 2248 - #: src/components/status.jsx:3294 2246 + #: src/components/status.jsx:1259 2247 + #: src/components/status.jsx:3275 2249 2248 msgid "Embed post" 2250 2249 msgstr "" 2251 2250 2252 - #: src/components/status.jsx:1292 2251 + #: src/components/status.jsx:1273 2253 2252 msgid "Conversation unmuted" 2254 2253 msgstr "" 2255 2254 2256 - #: src/components/status.jsx:1292 2255 + #: src/components/status.jsx:1273 2257 2256 msgid "Conversation muted" 2258 2257 msgstr "" 2259 2258 2260 - #: src/components/status.jsx:1298 2259 + #: src/components/status.jsx:1279 2261 2260 msgid "Unable to unmute conversation" 2262 2261 msgstr "" 2263 2262 2264 - #: src/components/status.jsx:1299 2263 + #: src/components/status.jsx:1280 2265 2264 msgid "Unable to mute conversation" 2266 2265 msgstr "" 2267 2266 2268 - #: src/components/status.jsx:1308 2267 + #: src/components/status.jsx:1289 2269 2268 msgid "Unmute conversation" 2270 2269 msgstr "" 2271 2270 2272 - #: src/components/status.jsx:1315 2271 + #: src/components/status.jsx:1296 2273 2272 msgid "Mute conversation" 2274 2273 msgstr "" 2275 2274 2276 - #: src/components/status.jsx:1331 2275 + #: src/components/status.jsx:1312 2277 2276 msgid "Post unpinned from profile" 2278 2277 msgstr "" 2279 2278 2280 - #: src/components/status.jsx:1332 2279 + #: src/components/status.jsx:1313 2281 2280 msgid "Post pinned to profile" 2282 2281 msgstr "" 2283 2282 2284 - #: src/components/status.jsx:1337 2283 + #: src/components/status.jsx:1318 2285 2284 msgid "Unable to unpin post" 2286 2285 msgstr "" 2287 2286 2288 - #: src/components/status.jsx:1337 2287 + #: src/components/status.jsx:1318 2289 2288 msgid "Unable to pin post" 2290 2289 msgstr "" 2291 2290 2292 - #: src/components/status.jsx:1346 2291 + #: src/components/status.jsx:1327 2293 2292 msgid "Unpin from profile" 2294 2293 msgstr "" 2295 2294 2296 - #: src/components/status.jsx:1353 2295 + #: src/components/status.jsx:1334 2297 2296 msgid "Pin to profile" 2298 2297 msgstr "" 2299 2298 2300 - #: src/components/status.jsx:1382 2299 + #: src/components/status.jsx:1363 2301 2300 msgid "Delete this post?" 2302 2301 msgstr "" 2303 2302 2304 - #: src/components/status.jsx:1398 2303 + #: src/components/status.jsx:1379 2305 2304 msgid "Post deleted" 2306 2305 msgstr "" 2307 2306 2308 - #: src/components/status.jsx:1401 2307 + #: src/components/status.jsx:1382 2309 2308 msgid "Unable to delete post" 2310 2309 msgstr "" 2311 2310 2312 - #: src/components/status.jsx:1429 2311 + #: src/components/status.jsx:1410 2313 2312 msgid "Report post…" 2314 2313 msgstr "" 2315 2314 2316 - #: src/components/status.jsx:1785 2317 - #: src/components/status.jsx:1821 2318 - #: src/components/status.jsx:2522 2315 + #: src/components/status.jsx:1766 2316 + #: src/components/status.jsx:1802 2317 + #: src/components/status.jsx:2503 2319 2318 msgid "Liked" 2320 2319 msgstr "" 2321 2320 2322 - #: src/components/status.jsx:1818 2323 - #: src/components/status.jsx:2509 2321 + #: src/components/status.jsx:1799 2322 + #: src/components/status.jsx:2490 2324 2323 msgid "Boosted" 2325 2324 msgstr "" 2326 2325 2327 - #: src/components/status.jsx:1828 2328 - #: src/components/status.jsx:2534 2326 + #: src/components/status.jsx:1809 2327 + #: src/components/status.jsx:2515 2329 2328 msgid "Bookmarked" 2330 2329 msgstr "" 2331 2330 2332 - #: src/components/status.jsx:1832 2331 + #: src/components/status.jsx:1813 2333 2332 msgid "Pinned" 2334 2333 msgstr "" 2335 2334 2336 - #: src/components/status.jsx:1878 2337 - #: src/components/status.jsx:2346 2335 + #: src/components/status.jsx:1859 2336 + #: src/components/status.jsx:2327 2338 2337 msgid "Deleted" 2339 2338 msgstr "" 2340 2339 2341 - #: src/components/status.jsx:1919 2340 + #: src/components/status.jsx:1900 2342 2341 msgid "{repliesCount, plural, one {# reply} other {# replies}}" 2343 2342 msgstr "" 2344 2343 2345 2344 #. placeholder {0}: snapStates.statusThreadNumber[sKey] ? ` ${snapStates.statusThreadNumber[sKey]}/X` : '' 2346 - #: src/components/status.jsx:2009 2345 + #: src/components/status.jsx:1990 2347 2346 msgid "Thread{0}" 2348 2347 msgstr "" 2349 2348 2350 - #: src/components/status.jsx:2087 2351 - #: src/components/status.jsx:2149 2352 - #: src/components/status.jsx:2242 2349 + #: src/components/status.jsx:2068 2350 + #: src/components/status.jsx:2130 2351 + #: src/components/status.jsx:2223 2353 2352 msgid "Show less" 2354 2353 msgstr "" 2355 2354 2356 - #: src/components/status.jsx:2087 2357 - #: src/components/status.jsx:2149 2355 + #: src/components/status.jsx:2068 2356 + #: src/components/status.jsx:2130 2358 2357 msgid "Show content" 2359 2358 msgstr "" 2360 2359 2361 2360 #. placeholder {0}: filterInfo.titlesStr 2362 2361 #. placeholder {0}: filterInfo?.titlesStr 2363 - #: src/components/status.jsx:2238 2362 + #: src/components/status.jsx:2219 2364 2363 #: src/pages/catchup.jsx:1875 2365 2364 msgid "Filtered: {0}" 2366 2365 msgstr "Filtered: {0}" 2367 2366 2368 - #: src/components/status.jsx:2242 2367 + #: src/components/status.jsx:2223 2369 2368 msgid "Show media" 2370 2369 msgstr "" 2371 2370 2372 - #: src/components/status.jsx:2382 2371 + #: src/components/status.jsx:2363 2373 2372 msgid "Edited" 2374 2373 msgstr "" 2375 2374 2376 - #: src/components/status.jsx:2459 2375 + #: src/components/status.jsx:2440 2377 2376 msgid "Comments" 2378 2377 msgstr "" 2379 2378 2380 2379 #. More from [Author] 2381 - #: src/components/status.jsx:2752 2380 + #: src/components/status.jsx:2733 2382 2381 msgid "More from <0/>" 2383 2382 msgstr "More from <0/>" 2384 2383 2385 - #: src/components/status.jsx:3054 2384 + #: src/components/status.jsx:3035 2386 2385 msgid "Edit History" 2387 2386 msgstr "" 2388 2387 2389 - #: src/components/status.jsx:3058 2388 + #: src/components/status.jsx:3039 2390 2389 msgid "Failed to load history" 2391 2390 msgstr "" 2392 2391 2393 - #: src/components/status.jsx:3063 2392 + #: src/components/status.jsx:3044 2394 2393 #: src/pages/annual-report.jsx:45 2395 2394 msgid "Loading…" 2396 2395 msgstr "" 2397 2396 2398 - #: src/components/status.jsx:3299 2397 + #: src/components/status.jsx:3280 2399 2398 msgid "HTML Code" 2400 2399 msgstr "" 2401 2400 2402 - #: src/components/status.jsx:3316 2401 + #: src/components/status.jsx:3297 2403 2402 msgid "HTML code copied" 2404 2403 msgstr "" 2405 2404 2406 - #: src/components/status.jsx:3319 2405 + #: src/components/status.jsx:3300 2407 2406 msgid "Unable to copy HTML code" 2408 2407 msgstr "" 2409 2408 2410 - #: src/components/status.jsx:3331 2409 + #: src/components/status.jsx:3312 2411 2410 msgid "Media attachments:" 2412 2411 msgstr "" 2413 2412 2414 - #: src/components/status.jsx:3353 2413 + #: src/components/status.jsx:3334 2415 2414 msgid "Account Emojis:" 2416 2415 msgstr "" 2417 2416 2418 - #: src/components/status.jsx:3384 2419 - #: src/components/status.jsx:3429 2417 + #: src/components/status.jsx:3365 2418 + #: src/components/status.jsx:3410 2420 2419 msgid "static URL" 2421 2420 msgstr "" 2422 2421 2423 - #: src/components/status.jsx:3398 2422 + #: src/components/status.jsx:3379 2424 2423 msgid "Emojis:" 2425 2424 msgstr "" 2426 2425 2427 - #: src/components/status.jsx:3443 2426 + #: src/components/status.jsx:3424 2428 2427 msgid "Notes:" 2429 2428 msgstr "" 2430 2429 2431 - #: src/components/status.jsx:3447 2430 + #: src/components/status.jsx:3428 2432 2431 msgid "This is static, unstyled and scriptless. You may need to apply your own styles and edit as needed." 2433 2432 msgstr "" 2434 2433 2435 - #: src/components/status.jsx:3453 2434 + #: src/components/status.jsx:3434 2436 2435 msgid "Polls are not interactive, becomes a list with vote counts." 2437 2436 msgstr "" 2438 2437 2439 - #: src/components/status.jsx:3458 2438 + #: src/components/status.jsx:3439 2440 2439 msgid "Media attachments can be images, videos, audios or any file types." 2441 2440 msgstr "" 2442 2441 2443 - #: src/components/status.jsx:3464 2442 + #: src/components/status.jsx:3445 2444 2443 msgid "Post could be edited or deleted later." 2445 2444 msgstr "" 2446 2445 2447 - #: src/components/status.jsx:3470 2446 + #: src/components/status.jsx:3451 2448 2447 msgid "Preview" 2449 2448 msgstr "" 2450 2449 2451 - #: src/components/status.jsx:3479 2450 + #: src/components/status.jsx:3460 2452 2451 msgid "Note: This preview is lightly styled." 2453 2452 msgstr "" 2454 2453 2455 2454 #. [Name] [Visibility icon] boosted 2456 - #: src/components/status.jsx:3732 2455 + #: src/components/status.jsx:3713 2457 2456 msgid "<0/> <1/> boosted" 2458 2457 msgstr "" 2459 2458