angular-t9n
Version:
A translation tool for Angular i18n
3 lines (2 loc) • 8.49 kB
JavaScript
import{a as le}from"./chunk-B75QZTIT.js";import{a as ae,b as _e}from"./chunk-TCB7CPXY.js";import{a as me,b as ce,c as pe,d as se,e as Te,f as Re,g as fe,h as Pe,i as Ae,j as Ce,k as Ee,l as Ne,m as Oe,n as Se}from"./chunk-34LVLGVL.js";import{a as re,b as de}from"./chunk-27GPMXRH.js";import{a as ne,b as ie,c as oe}from"./chunk-MFJLYQLJ.js";import{a as Me}from"./chunk-JZGDUES4.js";import{c as Z,e as ee,f as te}from"./chunk-PTK3D5EO.js";import"./chunk-QTUSJNUZ.js";import"./chunk-DK3NDEDW.js";import"./chunk-MLPE3OCH.js";import"./chunk-RVNPJH6Y.js";import{$ as E,Bb as T,Cb as R,Cc as W,Dc as Y,Eb as Q,Ib as r,Jb as M,Kb as U,L as B,P as S,Qa as a,S as j,Yb as l,Zb as c,_b as g,bb as q,bc as u,e as z,ea as F,ec as f,fa as V,fc as P,gb as s,o as O,pb as J,qb as K,ub as A,vb as n,wb as i,xb as N}from"./chunk-KWXDDR2S.js";import{c as k}from"./chunk-4CLCTAJ7.js";var ge=()=>["distance","id","description","meaning","source","target","state","action"];function ue(e,o){if(e&1&&(n(0,"dl")(1,"dt"),r(2,2),i(),n(3,"dd"),l(4),i(),n(5,"dt"),r(6,3),i(),n(7,"dd"),l(8),i(),n(9,"dt"),r(10,4),i(),n(11,"dd",35),l(12),i(),n(13,"dt"),r(14,5),i(),n(15,"dd",36),l(16),i(),n(17,"dt"),r(18,6),i(),n(19,"dd"),l(20),f(21,"titlecase"),i()()),e&2){let t=o;a(4),c(t.description||"-"),a(4),c(t.meaning||"-"),a(4),c(t.source),a(4),c(t.target),a(4),c(P(21,5,t.state))}}function he(e,o){e&1&&(n(0,"th",37),r(1,7),i())}function $e(e,o){if(e&1&&(n(0,"td",38),l(1),i()),e&2){let t=o.$implicit;a(),g(" ",t.distance," ")}}function be(e,o){e&1&&(n(0,"th",39),r(1,8),i())}function He(e,o){if(e&1&&(n(0,"td",40),l(1),i()),e&2){let t=o.$implicit;A("matTooltip",t.locations==null?null:t.locations.join(`
`))("matTooltipDisabled",!(t.locations!=null&&t.locations.length)),a(),g(" ",t.id," ")}}function Ge(e,o){e&1&&(n(0,"th",39),r(1,9),i())}function Ie(e,o){if(e&1&&(n(0,"td",41),l(1),i()),e&2){let t=o.$implicit;a(),c(t.description)}}function ye(e,o){e&1&&(n(0,"th",39),r(1,10),i())}function De(e,o){if(e&1&&(n(0,"td",41),l(1),i()),e&2){let t=o.$implicit;a(),c(t.meaning)}}function xe(e,o){e&1&&(n(0,"th",39),r(1,11),i())}function ve(e,o){if(e&1&&(n(0,"td",41),l(1),i()),e&2){let t=o.$implicit;a(),c(t.source)}}function Le(e,o){e&1&&(n(0,"th",39),r(1,12),i())}function Xe(e,o){if(e&1&&(n(0,"td",41),l(1),i()),e&2){let t=o.$implicit;a(),c(t.target)}}function we(e,o){e&1&&(n(0,"th",39),r(1,13),i())}function ke(e,o){if(e&1&&(n(0,"td",41),l(1),f(2,"titlecase"),i()),e&2){let t=o.$implicit;a(),c(P(2,1,t.state))}}function ze(e,o){e&1&&N(0,"th",42)}function Be(e,o){if(e&1){let t=Q();n(0,"td",41)(1,"button",43),M("click",function(){let d=F(t).$implicit,p=U();return V(p.migrate(d))}),n(2,"mat-icon"),l(3,"input"),i()()()}}function je(e,o){e&1&&N(0,"tr",44)}function Fe(e,o){e&1&&N(0,"tr",45)}var ct=(()=>{class e{constructor(){this._translationTargetService=E(Me),this._route=E(Z),this._router=E(ee),this._snackbar=E(le),this._destroy=new z,this.params=this._route.params.pipe(O(d=>{var p=d,{orphanId:t}=p,m=k(p,["orphanId"]);return m})),this.orphan=this._route.paramMap.pipe(S(t=>this._translationTargetService.orphan(t.get("orphanId"))),j(t=>this._orphan=t),B()),this.similar=this.orphan.pipe(O(t=>t._embedded.similar))}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}migrate(t){this.orphan&&this._orphanAction(this._translationTargetService.migrateOrphan(this._orphan,t),`Migrated orphan ${this._orphan.id} to unit ${t.id}`)}delete(){this.orphan&&this._orphanAction(this._translationTargetService.deleteOrphan(this._orphan),`Deleted orphan ${this._orphan.id}`)}_orphanAction(t,m){t.pipe(S(({orphansRemaining:d})=>this._router.navigate([d?"..":"../.."],{relativeTo:this._route}))).subscribe(()=>this._snackbar.open(m,void 0,{duration:2500}))}static{this.\u0275fac=function(m){return new(m||e)}}static{this.\u0275cmp=q({type:e,selectors:[["t9n-orphan"]],decls:43,vars:17,consts:()=>{let t;t=$localize`:␟a449a33f34e3a6c40b82058c0d69ff39a9f1e925␟2250356394431390492:Similar units`;let m;m=$localize`:␟c9ed6d0fde000bbbca6abfd191c853b5d1306719␟149862035788373642:Distance according to the levenshtein algorithm`;let d;d=$localize`:␟c9ed6d0fde000bbbca6abfd191c853b5d1306719␟149862035788373642:Distance according to the levenshtein algorithm`;let p;p=$localize`:␟cda31dbd724cf5f4fa7a4274d9120651490c8a8c␟8890553633144307762:Back`;let C;C=$localize`:␟53150cdcaa3fc290a4f4018e446e44b998f1f155␟5246620794703463867: Delete orphan `;let h;h=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let $;$=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let b;b=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let H;H=$localize`:␟38baeb215c17af9d9e295e371a57f4a48ab4c191␟4854396465510517671:Target`;let G;G=$localize`:␟873b72903b1858a9cd6c8967521030b4d7d1435b␟5911214550882917183:State`;let I;I=$localize`:␟33f0509c876e1399d92a9d1882ce38e6f4245ce3␟2590415407309830681: Distance `;let y;y=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`;let D;D=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let x;x=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let v;v=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let L;L=$localize`:␟38baeb215c17af9d9e295e371a57f4a48ab4c191␟4854396465510517671:Target`;let X;X=$localize`:␟873b72903b1858a9cd6c8967521030b4d7d1435b␟5911214550882917183:State`;let w;return w=$localize`:␟ed06ba25f8b8effadedaa466355f5b85b0041712␟7936624992717622100:Migrate translation and state to this unit and remove this orphan.`,[p,C,h,$,b,H,G,I,y,D,x,v,L,X,[1,"mat-elevation-z1"],["mat-table","","matSort","","aria-label",t,3,"dataSource"],["matColumnDef","distance"],["mat-header-cell","","matTooltip",m,4,"matHeaderCellDef"],["mat-cell","","matTooltip",d,4,"matCellDef"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled",4,"matCellDef"],["matColumnDef","description"],["mat-cell","",4,"matCellDef"],["matColumnDef","meaning"],["matColumnDef","source"],["matColumnDef","target"],["matColumnDef","state"],["matColumnDef","action"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"actions"],["mat-raised-button","","color","primary","routerLink","..",3,"queryParams"],["type","button","mat-raised-button","","color","warn",3,"click"],[1,"source"],[1,"target"],["mat-header-cell","","matTooltip",m],["mat-cell","","matTooltip",d],["mat-header-cell","","mat-sort-header",""],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled"],["mat-cell",""],["mat-header-cell",""],["type","button","mat-icon-button","","matTooltip",w,3,"click"],["mat-header-row",""],["mat-row",""]]},template:function(m,d){if(m&1&&(n(0,"h2"),l(1),f(2,"async"),i(),J(3,ue,22,7,"dl"),f(4,"async"),n(5,"div",14)(6,"table",15),f(7,"async"),T(8,16),s(9,he,2,0,"th",17)(10,$e,2,1,"td",18),R(),T(11,19),s(12,be,2,0,"th",20)(13,He,2,3,"td",21),R(),T(14,22),s(15,Ge,2,0,"th",20)(16,Ie,2,1,"td",23),R(),T(17,24),s(18,ye,2,0,"th",20)(19,De,2,1,"td",23),R(),T(20,25),s(21,xe,2,0,"th",20)(22,ve,2,1,"td",23),R(),T(23,26),s(24,Le,2,0,"th",20)(25,Xe,2,1,"td",23),R(),T(26,27),s(27,we,2,0,"th",20)(28,ke,3,3,"td",23),R(),T(29,28),s(30,ze,1,0,"th",29)(31,Be,4,0,"td",23),R(),s(32,je,1,0,"tr",30)(33,Fe,1,0,"tr",31),i()(),n(34,"div",32)(35,"a",33),f(36,"async"),n(37,"mat-icon"),l(38,"keyboard_backspace"),i(),T(39),r(40,0),R(),i(),n(41,"button",34),M("click",function(){return d.delete()}),r(42,1),i()()),m&2){let p,C;a(),c((p=P(2,7,d.orphan))==null?null:p.id),a(2),K((C=P(4,9,d.orphan))?3:-1,C),a(3),A("dataSource",P(7,11,d.similar)),a(26),A("matHeaderRowDef",u(15,ge))("matHeaderRowDefSticky",!0),a(),A("matRowDefColumns",u(16,ge)),a(2),A("queryParams",P(36,13,d.params))}},dependencies:[Se,se,Re,Ce,fe,Te,Ee,Pe,Ae,Ne,Oe,pe,me,ce,de,re,oe,ie,ne,_e,ae,te,W,Y],styles:["[_nghost-%COMP%]{display:block;padding:0 1.5rem 1.5rem}.source[_ngcontent-%COMP%], .target[_ngcontent-%COMP%]{white-space:pre-wrap}table[_ngcontent-%COMP%]{margin-bottom:1rem}.actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})}}return e})();export{ct as OrphanComponent};